FOUR-12686: Restart processmaker:consume
command(s) when config changes
#5756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
All ProcessMaker settings are persisted in the database, but are also set in the laravel
config()
. When the config is cached, it is stored inbootstrap/cache/config.php
, which each instance of the app uses when booting up.Currently, we restart the job queue by listening for config changes since it is a long-running command (
php artisan horizon
) and only reads frombootstrap/cache/config.php
once when it starts.When testing an Actions By Email feature, the settings changes which were made were not picked up by the (more recent)
processmaker:consume
artisan command, which is also long-running. This caused an exception to be thrown in theprocessmaker:consume
command's process when the ABE email was attempted to be sent.Solution
Call the
kafka:restart-consumers
command to restart all running commands to pick up the new configuration change.Reproduction Steps
php artisan config:cache
)processmaker:consume
command and notice the errorsHow to Test
Run through the reproduction steps 3-6 and ensure the
processmaker:consume
command is restartedRelated Tickets & Packages
Code Review Checklist