Skip to content

Conversation

@zenzenless
Copy link

Description

This PR modifies the GetModules function to ensure that the execution order of modules aligns with the sequence constructed by the developer using BuildModules(), rather than relying on the order in the config.yml file. In certain cases, the execution order of specific modules is critical. For example, in the Callisto project, the message_type module must execute before the messages module to prevent database insertion failures due to the foreign key relationship that messages has with message_type.

If the order is not ensured correctly, errors such as the following may occur:

ERR error while handling message err="pq: insert or update on table \"message_0\" violates foreign key constraint \"message_type_fkey\""

Changes Made

Updated the GetModules function to check and return modules in the specified order based on the provided names.
Added validation to log errors for any required but unregistered modules.

Please review these changes to ensure they meet the project's requirements and best practices.

Checklist

  • Targeted PR against correct branch.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit tests.
  • Re-reviewed Files changed in the Github PR explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant