From 87eb6f0c6be215baed8fb714e260b2318a620995 Mon Sep 17 00:00:00 2001 From: Sander Lienaerts Date: Fri, 1 Dec 2023 13:46:08 +0100 Subject: [PATCH] [IMP] queue_job_cron_jobrunner: pre-commit auto fixes --- queue_job_cron_jobrunner/README.rst | 81 ++++++++++--------- queue_job_cron_jobrunner/pyproject.toml | 3 + queue_job_cron_jobrunner/readme/CONFIGURE.md | 24 ++++++ queue_job_cron_jobrunner/readme/CONFIGURE.rst | 21 ----- .../readme/CONTRIBUTORS.md | 3 + .../readme/CONTRIBUTORS.rst | 3 - .../readme/DESCRIPTION.md | 17 ++++ .../readme/DESCRIPTION.rst | 14 ---- queue_job_cron_jobrunner/readme/ROADMAP.md | 4 + queue_job_cron_jobrunner/readme/ROADMAP.rst | 3 - .../static/description/index.html | 63 ++++++++------- 11 files changed, 129 insertions(+), 107 deletions(-) create mode 100644 queue_job_cron_jobrunner/pyproject.toml create mode 100644 queue_job_cron_jobrunner/readme/CONFIGURE.md delete mode 100644 queue_job_cron_jobrunner/readme/CONFIGURE.rst create mode 100644 queue_job_cron_jobrunner/readme/CONTRIBUTORS.md delete mode 100644 queue_job_cron_jobrunner/readme/CONTRIBUTORS.rst create mode 100644 queue_job_cron_jobrunner/readme/DESCRIPTION.md delete mode 100644 queue_job_cron_jobrunner/readme/DESCRIPTION.rst create mode 100644 queue_job_cron_jobrunner/readme/ROADMAP.md delete mode 100644 queue_job_cron_jobrunner/readme/ROADMAP.rst diff --git a/queue_job_cron_jobrunner/README.rst b/queue_job_cron_jobrunner/README.rst index 89d43d1e14..df6a1a1a2a 100644 --- a/queue_job_cron_jobrunner/README.rst +++ b/queue_job_cron_jobrunner/README.rst @@ -17,31 +17,34 @@ Queue Job Cron Jobrunner :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github - :target: https://github.com/OCA/queue/tree/16.0/queue_job_cron_jobrunner + :target: https://github.com/OCA/queue/tree/17.0/queue_job_cron_jobrunner :alt: OCA/queue .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-queue_job_cron_jobrunner + :target: https://translation.odoo-community.org/projects/queue-17-0/queue-17-0-queue_job_cron_jobrunner :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/queue&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module implements a simple ``queue.job`` runner using ``ir.cron`` triggers. +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. +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: +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. +- 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. +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. .. IMPORTANT:: This is an alpha version, the data model and design can change at any time without warning. @@ -56,34 +59,38 @@ no channel capacity nor priorities. Please check the ROADMAP for further details Configuration ============= -.. warning:: +Warning - Don't use this module if you're already running the regular ``queue_job`` runner. +Don't use this module if you're already running the regular +``queue_job`` runner. +For the easiest case, no configuration is required besides installing +the module. -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. -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. +Note -.. note:: +In Odoo.sh, this is done by default. - In Odoo.sh, this is done by default. +Parallel execution of jobs can be achieved by leveraging multiple +``ir.cron`` records: - -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. +- 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``) +- 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 =========== @@ -91,7 +98,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -99,19 +106,19 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp SA Contributors -~~~~~~~~~~~~ +------------ -* `Camptocamp `_ +- `Camptocamp `__ - * Iván Todorovich + - Iván Todorovich Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -131,6 +138,6 @@ Current `maintainer `__: |maintainer-ivantodorovich| -This module is part of the `OCA/queue `_ project on GitHub. +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. diff --git a/queue_job_cron_jobrunner/pyproject.toml b/queue_job_cron_jobrunner/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/queue_job_cron_jobrunner/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/queue_job_cron_jobrunner/readme/CONFIGURE.md b/queue_job_cron_jobrunner/readme/CONFIGURE.md new file mode 100644 index 0000000000..109a7654b9 --- /dev/null +++ b/queue_job_cron_jobrunner/readme/CONFIGURE.md @@ -0,0 +1,24 @@ +Warning + +Don't use this module if you're already running the regular `queue_job` +runner. + +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. + +Note + +In Odoo.sh, this is done by default. + +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. diff --git a/queue_job_cron_jobrunner/readme/CONFIGURE.rst b/queue_job_cron_jobrunner/readme/CONFIGURE.rst deleted file mode 100644 index 0de15596d2..0000000000 --- a/queue_job_cron_jobrunner/readme/CONFIGURE.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. warning:: - - Don't use this module if you're already running the regular ``queue_job`` runner. - - -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. - -.. note:: - - In Odoo.sh, this is done by default. - - -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. diff --git a/queue_job_cron_jobrunner/readme/CONTRIBUTORS.md b/queue_job_cron_jobrunner/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..35c75cb4cb --- /dev/null +++ b/queue_job_cron_jobrunner/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Camptocamp](https://www.camptocamp.com) + + > - Iván Todorovich \<\> diff --git a/queue_job_cron_jobrunner/readme/CONTRIBUTORS.rst b/queue_job_cron_jobrunner/readme/CONTRIBUTORS.rst deleted file mode 100644 index 59b447f28a..0000000000 --- a/queue_job_cron_jobrunner/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,3 +0,0 @@ -* `Camptocamp `_ - - * Iván Todorovich diff --git a/queue_job_cron_jobrunner/readme/DESCRIPTION.md b/queue_job_cron_jobrunner/readme/DESCRIPTION.md new file mode 100644 index 0000000000..e6dcbeabfc --- /dev/null +++ b/queue_job_cron_jobrunner/readme/DESCRIPTION.md @@ -0,0 +1,17 @@ +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. diff --git a/queue_job_cron_jobrunner/readme/DESCRIPTION.rst b/queue_job_cron_jobrunner/readme/DESCRIPTION.rst deleted file mode 100644 index e713aa89a9..0000000000 --- a/queue_job_cron_jobrunner/readme/DESCRIPTION.rst +++ /dev/null @@ -1,14 +0,0 @@ -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. diff --git a/queue_job_cron_jobrunner/readme/ROADMAP.md b/queue_job_cron_jobrunner/readme/ROADMAP.md new file mode 100644 index 0000000000..cf1932bcc1 --- /dev/null +++ b/queue_job_cron_jobrunner/readme/ROADMAP.md @@ -0,0 +1,4 @@ +- 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`) diff --git a/queue_job_cron_jobrunner/readme/ROADMAP.rst b/queue_job_cron_jobrunner/readme/ROADMAP.rst deleted file mode 100644 index b82e199202..0000000000 --- a/queue_job_cron_jobrunner/readme/ROADMAP.rst +++ /dev/null @@ -1,3 +0,0 @@ -* 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``) diff --git a/queue_job_cron_jobrunner/static/description/index.html b/queue_job_cron_jobrunner/static/description/index.html index 40646f1bfd..4ab0d894fb 100644 --- a/queue_job_cron_jobrunner/static/description/index.html +++ b/queue_job_cron_jobrunner/static/description/index.html @@ -369,19 +369,22 @@

Queue Job Cron Jobrunner

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:ea15f976f55eddd46d51fc2bb989455756811717bbdc8f69764d02a0d6014b32 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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:

+

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.
  • +
  • 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.

+

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.

Important

This is an alpha version, the data model and design can change at any time without warning. @@ -404,23 +407,24 @@

Queue Job Cron Jobrunner

Configuration

-
-

Warning

-

Don’t use this module if you’re already running the regular queue_job runner.

-
-

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.

-
-

Note

-

In Odoo.sh, this is done by default.

-
-

Parallel execution of jobs can be achieved by leveraging multiple ir.cron records:

+

Warning

+

Don’t use this module if you’re already running the regular +queue_job runner.

+

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.

+

Note

+

In Odoo.sh, this is done by default.

+

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.
  • +
  • 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.
@@ -428,7 +432,8 @@

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)
  • +
  • Commit transaction after job state updated to started. (See +_process)
@@ -436,7 +441,7 @@

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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -468,7 +473,7 @@

Maintainers

promote its widespread use.

Current maintainer:

ivantodorovich

-

This module is part of the OCA/queue project on GitHub.

+

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.