Add the option to configure the enqueued_delta and started_delta parameters on a channel by channel basis. If not set it will use the global value set in the cron
The use case we have for this is that we use the cron to catch any jobs that get stuck in started when the Odoo gets automatically deployed, in order for it to be mostly invisible to the end user and not have a blocked queue for long, the value should be low (5 or so). But we have some other processes that due to the length get sent to background tasks as jobs and might exceed this 5 minute mark, causing them to requeue infinitely. The ideal situation is optimizing the job or refactoring the whole thing to have <5min jobs but being able to allow some jobs to be longer is much more convenient and often will be enough of a solution to the issue.
Some extra notes
The domain it generates is much bigger than the previous one depending on the number of channels, but the cron execution was still instantaneous during my tests on a database with 26 channels and 3.5m job records
The [("channel", "not in", searched_channels)] part of the domain is for jobs that are created in a specific channel but without creating the corresponding queue.job.channel record, I would deem it technically a poor usage by the job creator (I have done it before) but it would be a regression for these cases if not taken into account
enqueued_delta
andstarted_delta
parameters on a channel by channel basis. If not set it will use the global value set in the cronstarted
when the Odoo gets automatically deployed, in order for it to be mostly invisible to the end user and not have a blocked queue for long, the value should be low (5 or so). But we have some other processes that due to the length get sent to background tasks as jobs and might exceed this 5 minute mark, causing them to requeue infinitely. The ideal situation is optimizing the job or refactoring the whole thing to have <5min jobs but being able to allow some jobs to be longer is much more convenient and often will be enough of a solution to the issue.Some extra notes
[("channel", "not in", searched_channels)]
part of the domain is for jobs that are created in a specific channel but without creating the correspondingqueue.job.channel
record, I would deem it technically a poor usage by the job creator (I have done it before) but it would be a regression for these cases if not taken into account