Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -475,5 +480,6 @@ This addon adds an integrated Job Queue to Odoo.
@@ -484,24 +484,87 @@There are two ways to configure the job runner:
+Set channels (or ODOO_QUEUE_JOB_CHANNELS) and every database +shares the same channel tree (we will call it server-wide channels):
++[queue_job] +channels = root:10,root.priority:3,root.slow:1 ++
Leave channels unset and set max_capacity instead. The job +runner then builds a separate channel tree for each database, based on +the Job Channels configured on each database (we will call it +per-database channels).
++[queue_job] +max_capacity = 10 ++
channels always has precedence over max_capacity. If +channels is set, the per-database configuration is not used. If +neither channels nor max_capacity are set, the default execution +mode is per-database channels with a max_capacity of 1.
+In the per-database mode, channels are configured from the Job +Channels menu (or by XML data, see the Usage) instead of a global +configuration string.
+Alongside max_capacity, a global configuration db_max_capacity +can be set. It represents the max number of jobs executed at the same +time for a single database (capped by the max_capacity anyway):
++[queue_job] +max_capacity = 10 +db_max_capacity = 3 # no more than 3 simultaneous jobs per database ++
db_max_capacity may be an integer or a pattern such as +prod_*:20,staging:2,*:5, where the first match wins. When using a +pattern, unmatched databases can be configured by a global pattern at +the end (*:n), otherwise they will use the max_capacity.
+The root channel capacity of a database can still be set independently, +however, will in any case be capped by the global max_capacity and +db_max_capacity parameters.
+When set to 0, max_capacity or db_max_capacity means there is no +jobs executed.
+Editing a channel’s capacity, sequential flag, throttle or set it to +pause from the Job Channels menu is applied live on the job +runner.
+Note
+A new database still needs the jobrunner to be restarted.
+When using the server-wide channels, the configuration is static and +loaded at startup of the jobrunner.
+The execution of channels by the job runner is defined by:
+Job Runner Configuration Parameters
[options] @@ -512,6 +575,8 @@Configuration
(...) [queue_job] channels = root:2 +max_capacity = 8 +db_max_capacity = 3 scheme = https host = load-balancer port = 443 @@ -519,6 +584,18 @@Configuration
http_auth_password = s3cr3t
+[options] +(...) +workers = 6 +server_wide_modules = web,queue_job ++
Migrating from server-wide channels to per-database channels
+As long as channels (or ODOO_QUEUE_JOB_CHANNELS) is set, the job +runner keeps using the server-wide channels.
+To move to channels per database:
+