Search 1.9 billion lines of Odoo code on GitHub

queue_job_cron_jobrunner

Author: Camptocamp SA, Odoo Community Association (OCA)
License: AGPL-3
Branch: 15.0
Repository: aurestic/queue
Dependencies: base, and queue_job
Languages: HTML (385, 59.2%), Python (157, 24.2%), XML (29, 4.5%), and reStructuredText (79, 12.2%)
Other branches: 14.0, and 16.0
Other repositories: ACCOMODATA-BVBA/queue, Change2improve/queue, Digital5-Odoo/queue, ForgeFlow/queue, Gabinete-Digital/queue, Ingeos/queue, Jarsa/queue, OCA/queue, SeuMarco/queue, TRESCLOUD/queue, Vauxoo/queue, acsone/queue, akretion/queue, brain-tec/queue, camptocamp/queue, coopiteasy/queue, factorlibre/queue, guewen/queue, hibou-io/oca-queue, nilshamerlinck/queue, and tegin/queue

<h1 class="title">Queue Job Cron Jobrunner</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/queue/tree/15.0/queue_job_cron_jobrunner"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/queue-15-0/queue-15-0-queue_job_cron_jobrunner"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/230/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module implements a simple <code>queue.job</code> runner using <code>ir.cron</code> triggers.</p> <p>It's meant to be used on environments where the regular job runner can't be run, like on Odoo.sh.</p> <p>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:</p> <ul class="simple"> <li>Odoo.sh puts HttpWorkers to sleep when there's no network activity</li> <li>HttpWorkers are meant for traffic. Users shouldn't pay the price of background tasks.</li> </ul> <p>For now, it only implements the most basic features of the <code>queue_job</code> runner, notably no channel capacity nor priorities. Please check the ROADMAP for further details.</p> <div class="admonition important"> <p class="first admonition-title">Important</p> <p class="last">This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. <a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p> </div> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li> <li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li> <li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id4">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id5">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li> </ul> </li> </ul> </div> <a name="configuration"></a> <h2><a class="toc-backref" href="#id1">Configuration</a></h2> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">Don't use this module if you're already running the regular <code>queue_job</code> runner.</p> </div> <p>For the easiest case, no configuration is required besides installing the module.</p> <p>To avoid CronWorker CPU timeout from abruptly stopping the job processing cron, it's recommended to launch Odoo with <code>--limit-time-real-cron=0</code>, to disable the CronWorker timeout altogether.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">In Odoo.sh, this is done by default.</p> </div> <p>Parallel execution of jobs can be achieved by leveraging multiple <code>ir.cron</code> records:</p> <ul class="simple"> <li>Make sure you have enough CronWorkers available (Odoo CLI <code>--max-cron-threads</code>)</li> <li>Duplicate the <code>queue_job_cron</code> cron record as many times as needed, until you have as much records as cron workers.</li> </ul> <a name="known-issues-roadmap"></a> <h2><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h2> <ul class="simple"> <li>Support channel capacity and priority. (See <code>_acquire_one_job</code>)</li> <li>Gracefully handle CronWorker CPU timeouts. (See <code>_job_runner</code>)</li> <li>Commit transaction after job state updated to started. (See <code>_process</code>)</li> </ul> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id3">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron_jobrunner%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id4">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id5">Authors</a></h3> <ul class="simple"> <li>Camptocamp SA</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id6">Contributors</a></h3> <ul> <li><p class="first"><a class="reference external" href="https://www.camptocamp.com">Camptocamp</a></p> <blockquote> <ul class="simple"> <li>Iván Todorovich &lt;<a class="reference external" href="mailto:ivan.todorovich&#64;camptocamp.com">ivan.todorovich&#64;camptocamp.com</a>&gt;</li> </ul> </blockquote> </li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id7">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>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.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/ivantodorovich"><img alt="ivantodorovich" src="https://github.com/ivantodorovich.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/15.0/queue_job_cron_jobrunner">OCA/queue</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>