Run jobs without a dedicated JobRunner
Project description
This module implements a simple queue.job runner using ir.cron triggers.
It’s meant to be used on environments where the regular job runner can’t be run, like on Odoo.sh.
Unlike the regular job runner, where jobs are dispatched to the HttpWorkers, jobs are processed on the CronWorker threads by the job runner crons. This is a design decision because:
Odoo.sh puts HttpWorkers to sleep when there’s no network activity
HttpWorkers are meant for traffic. Users shouldn’t pay the price of background tasks.
For now, it only implements the most basic features of the queue_job runner, notably no channel capacity nor priorities. Please check the ROADMAP for further details.
Table of contents
Configuration
For the easiest case, no configuration is required besides installing the module.
To avoid CronWorker CPU timeout from abruptly stopping the job processing cron, it’s recommended to launch Odoo with --limit-time-real-cron=0, to disable the CronWorker timeout altogether.
Parallel execution of jobs can be achieved by leveraging multiple ir.cron records:
Make sure you have enough CronWorkers available (Odoo CLI --max-cron-threads)
Duplicate the queue_job_cron cron record as many times as needed, until you have as much records as cron workers.
Known issues / Roadmap
Support channel capacity and priority. (See _acquire_one_job)
Gracefully handle CronWorker CPU timeouts. (See _job_runner)
Commit transaction after job state updated to started. (See _process)
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
-
Iván Todorovich <ivan.todorovich@camptocamp.com>
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
Current maintainer:
This module is part of the OCA/queue project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file odoo14_addon_queue_job_cron_jobrunner-14.0.1.0.3-py3-none-any.whl
.
File metadata
- Download URL: odoo14_addon_queue_job_cron_jobrunner-14.0.1.0.3-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56031401859f9f6e2523f9b2e03781b7a83789f41d14bddf424d1039ecd4979 |
|
MD5 | e7e8aba594cbb75baa078de94139325d |
|
BLAKE2b-256 | f633dde908d51d02eb46f3f7837a5ea2e90bf7e70368c9ab984f2c15579e4253 |