Skip to main content

Run jobs without a dedicated JobRunner

Project description

Alpha License: AGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

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

Authors

  • Camptocamp SA

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

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:

ivantodorovich

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

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

File hashes

Hashes for odoo14_addon_queue_job_cron_jobrunner-14.0.1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f56031401859f9f6e2523f9b2e03781b7a83789f41d14bddf424d1039ecd4979
MD5 e7e8aba594cbb75baa078de94139325d
BLAKE2b-256 f633dde908d51d02eb46f3f7837a5ea2e90bf7e70368c9ab984f2c15579e4253

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page