fix(queue_job): out-of-the-box support in test environments #470
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.
When you use queue_job, it is common to add some configuration to it.
The canonical way to do that with doodba would be to put a file in some path such as
odoo/custom/conf.d/queue_job.conf
and contents like these:However, in that case, the file would be used too by a test environment.
Test environments have 2 workers hardcoded, to save computational power for the production instance:
doodba-copier-template/test.yaml.jinja
Line 50 in e2f4efd
However, if you configure 2 workers with
channels = root:3
, you're doomed. Any delayed action in a test environment will block the server. At least, if the amount of delayed actions in batch is more than the current workers.I'm adding docs to queue_job in OCA/queue#650 to make this behavior clear. Also, here I'm adding an environment variable that will be harmless in test environments without
queue_job
, but will provide a sane default for those that use it.@moduon MT-6106