-
-
Notifications
You must be signed in to change notification settings - Fork 532
Closed
Description
The decision to write the jobrunner was made very early on. In my understanding, it was designed to allow fast parallel execution of background jobs in multiple channels, also allowing a hierarchy of channels.
However, I'm asking myself why not offer users the alternative to use ir.cron to run jobs. That would look as follows:
- Each channel has a corresponding
ir.cronrecord, disabled by default - These crons trigger periodically eg. every 1 minute or 5 minutes (configurable)
- When triggered, the cron start a loop to processing jobs assigned to the channel, just like the jobrunner does. The loop can be configured to run a maximum of eg. 100 times or 1000 times (configurable) before it stops and waits to be triggered again. Of course, a database commit would run after each iteration.
What would be the benefits or problems with such an approach?
Benefits I can think of:
- It would play well with odoo.sh
- It's easier to configure eg. no
server_wide_modulesor special Odoo settings - It's less complex / easier to understand / debug
- It's straightforward to enable or disable a channel
- Channels could be created and removed dynamically
Downsides:
- There will be periods of 'pause' when no jobs are run - between the end and the next trigger of a cron run
- Hierarchy of channels / channel capacity could be more difficult to implement
max_cron_threadswould have to be high enough, warn user if he exhausts them- ... probably some I havent thought of
Metadata
Metadata
Assignees
Labels
No labels