|
| 1 | +======================== |
| 2 | +Queue Job Cron Jobrunner |
| 3 | +======================== |
| 4 | + |
| 5 | +.. |
| 6 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 7 | + !! This file is generated by oca-gen-addon-readme !! |
| 8 | + !! changes will be overwritten. !! |
| 9 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 10 | + !! source digest: sha256:ea15f976f55eddd46d51fc2bb989455756811717bbdc8f69764d02a0d6014b32 |
| 11 | + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 12 | +
|
| 13 | +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png |
| 14 | + :target: https://odoo-community.org/page/development-status |
| 15 | + :alt: Alpha |
| 16 | +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png |
| 17 | + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
| 18 | + :alt: License: AGPL-3 |
| 19 | +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github |
| 20 | + :target: https://github.com/OCA/queue/tree/17.0/queue_job_cron_jobrunner |
| 21 | + :alt: OCA/queue |
| 22 | +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png |
| 23 | + :target: https://translation.odoo-community.org/projects/queue-17-0/queue-17-0-queue_job_cron_jobrunner |
| 24 | + :alt: Translate me on Weblate |
| 25 | +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png |
| 26 | + :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=17.0 |
| 27 | + :alt: Try me on Runboat |
| 28 | + |
| 29 | +|badge1| |badge2| |badge3| |badge4| |badge5| |
| 30 | + |
| 31 | +This module implements a simple ``queue.job`` runner using ``ir.cron`` |
| 32 | +triggers. |
| 33 | + |
| 34 | +It's meant to be used on environments where the regular job runner can't |
| 35 | +be run, like on Odoo.sh. |
| 36 | + |
| 37 | +Unlike the regular job runner, where jobs are dispatched to the |
| 38 | +HttpWorkers, jobs are processed on the CronWorker threads by the job |
| 39 | +runner crons. This is a design decision because: |
| 40 | + |
| 41 | +- Odoo.sh puts HttpWorkers to sleep when there's no network activity |
| 42 | +- HttpWorkers are meant for traffic. Users shouldn't pay the price of |
| 43 | + background tasks. |
| 44 | + |
| 45 | +For now, it only implements the most basic features of the ``queue_job`` |
| 46 | +runner, notably no channel capacity nor priorities. Please check the |
| 47 | +ROADMAP for further details. |
| 48 | + |
| 49 | +.. IMPORTANT:: |
| 50 | + This is an alpha version, the data model and design can change at any time without warning. |
| 51 | + Only for development or testing purpose, do not use in production. |
| 52 | + `More details on development status <https://odoo-community.org/page/development-status>`_ |
| 53 | + |
| 54 | +**Table of contents** |
| 55 | + |
| 56 | +.. contents:: |
| 57 | + :local: |
| 58 | + |
| 59 | +Configuration |
| 60 | +============= |
| 61 | + |
| 62 | +Warning |
| 63 | + |
| 64 | +Don't use this module if you're already running the regular |
| 65 | +``queue_job`` runner. |
| 66 | + |
| 67 | +For the easiest case, no configuration is required besides installing |
| 68 | +the module. |
| 69 | + |
| 70 | +To avoid CronWorker CPU timeout from abruptly stopping the job |
| 71 | +processing cron, it's recommended to launch Odoo with |
| 72 | +``--limit-time-real-cron=0``, to disable the CronWorker timeout |
| 73 | +altogether. |
| 74 | + |
| 75 | +Note |
| 76 | + |
| 77 | +In Odoo.sh, this is done by default. |
| 78 | + |
| 79 | +Parallel execution of jobs can be achieved by leveraging multiple |
| 80 | +``ir.cron`` records: |
| 81 | + |
| 82 | +- Make sure you have enough CronWorkers available (Odoo CLI |
| 83 | + ``--max-cron-threads``) |
| 84 | +- Duplicate the ``queue_job_cron`` cron record as many times as needed, |
| 85 | + until you have as much records as cron workers. |
| 86 | + |
| 87 | +Known issues / Roadmap |
| 88 | +====================== |
| 89 | + |
| 90 | +- Support channel capacity and priority. (See ``_acquire_one_job``) |
| 91 | +- Gracefully handle CronWorker CPU timeouts. (See ``_job_runner``) |
| 92 | +- Commit transaction after job state updated to started. (See |
| 93 | + ``_process``) |
| 94 | + |
| 95 | +Bug Tracker |
| 96 | +=========== |
| 97 | + |
| 98 | +Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_. |
| 99 | +In case of trouble, please check there if your issue has already been reported. |
| 100 | +If you spotted it first, help us to smash it by providing a detailed and welcomed |
| 101 | +`feedback <https://github.com/OCA/queue/issues/new?body=module:%20queue_job_cron_jobrunner%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
| 102 | + |
| 103 | +Do not contact contributors directly about support or help with technical issues. |
| 104 | + |
| 105 | +Credits |
| 106 | +======= |
| 107 | + |
| 108 | +Authors |
| 109 | +------- |
| 110 | + |
| 111 | +* Camptocamp SA |
| 112 | + |
| 113 | +Contributors |
| 114 | +------------ |
| 115 | + |
| 116 | +- `Camptocamp <https://www.camptocamp.com>`__ |
| 117 | + |
| 118 | + - Iván Todorovich <ivan.todorovich@camptocamp.com> |
| 119 | + |
| 120 | +Maintainers |
| 121 | +----------- |
| 122 | + |
| 123 | +This module is maintained by the OCA. |
| 124 | + |
| 125 | +.. image:: https://odoo-community.org/logo.png |
| 126 | + :alt: Odoo Community Association |
| 127 | + :target: https://odoo-community.org |
| 128 | + |
| 129 | +OCA, or the Odoo Community Association, is a nonprofit organization whose |
| 130 | +mission is to support the collaborative development of Odoo features and |
| 131 | +promote its widespread use. |
| 132 | + |
| 133 | +.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px |
| 134 | + :target: https://github.com/ivantodorovich |
| 135 | + :alt: ivantodorovich |
| 136 | + |
| 137 | +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |
| 138 | + |
| 139 | +|maintainer-ivantodorovich| |
| 140 | + |
| 141 | +This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/17.0/queue_job_cron_jobrunner>`_ project on GitHub. |
| 142 | + |
| 143 | +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
0 commit comments