[14.0][FIX] queue_job: support for multi-db environments #416
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.
This change improves functionality in environments with multiple databases in the postgres cluster. Some environments have hidden databases, and may use list_db = False in favor of the db_filter config parameter. In these cases, exp_list will return an AccessError. Or, some environments may have multiple databases used by multiple instances of Odoo, managed by a load balancer. It's possible that not all DBs will have the queue_job module installed. Sometimes, we will want the job runner to work on a limited set of DBs.
This change adds the option of an environment variable, ODOO_QUEUE_JOB_DB_NAME, or a config parameter in the [queue] section, jobrunner_db_name. This takes a comma separated list of DB names, just like db_name does. If the variable/parameter is not set, it defaults to db_name (the previous functionality).
Related:
#379 - Another fix for 12.0, solves the same problem when list_db=False
#58 - This resolves the issue