diff --git a/README.md b/README.md index 22c1139b8d..1b72f64a0a 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ addon | version | maintainers | summary --- | --- | --- | --- [base_export_async](base_export_async/) | 16.0.1.1.0 | | Asynchronous export with job queue [base_import_async](base_import_async/) | 16.0.1.2.0 | | Import CSV files in the background -[queue_job](queue_job/) | 16.0.2.11.3 | guewen | Job Queue +[queue_job](queue_job/) | 16.0.2.11.4 | guewen | Job Queue [queue_job_batch](queue_job_batch/) | 16.0.1.0.1 | | Job Queue Batch [queue_job_cron](queue_job_cron/) | 16.0.2.1.0 | | Scheduled Actions as Queue Jobs [queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 16.0.1.1.0 | ivantodorovich | Run jobs without a dedicated JobRunner diff --git a/queue_job/README.rst b/queue_job/README.rst index 70a6f226a5..b8783da288 100644 --- a/queue_job/README.rst +++ b/queue_job/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ========= Job Queue ========= @@ -7,13 +11,13 @@ Job Queue !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c150a0d1ce7847e0b7af0f868c0f2674b2530d601e8f8b259865ea5cd9d05c0b + !! source digest: sha256:7cc71c9aa5e6aec02e31b34ff1df8b45615787be688cbb13ac7714243400d7f8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png :target: https://odoo-community.org/page/development-status :alt: Mature -.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github diff --git a/queue_job/__manifest__.py b/queue_job/__manifest__.py index a11068eecc..c3a90b91bc 100644 --- a/queue_job/__manifest__.py +++ b/queue_job/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Job Queue", - "version": "16.0.2.11.3", + "version": "16.0.2.11.4", "author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)", "website": "https://github.com/OCA/queue", "license": "LGPL-3", diff --git a/queue_job/jobrunner/runner.py b/queue_job/jobrunner/runner.py index 7f935c63d7..4e662ebf4e 100644 --- a/queue_job/jobrunner/runner.py +++ b/queue_job/jobrunner/runner.py @@ -333,6 +333,7 @@ def _query_requeue_dead_jobs(self): CASE WHEN max_retries IS NOT NULL AND + max_retries != 0 AND -- infinite retries if max_retries is 0 retry IS NOT NULL AND retry>max_retries THEN 'failed' @@ -343,6 +344,7 @@ def _query_requeue_dead_jobs(self): CASE WHEN max_retries IS NOT NULL AND + max_retries != 0 AND -- infinite retries if max_retries is 0 retry IS NOT NULL AND retry>max_retries THEN 'JobFoundDead' @@ -352,6 +354,7 @@ def _query_requeue_dead_jobs(self): CASE WHEN max_retries IS NOT NULL AND + max_retries != 0 AND -- infinite retries if max_retries is 0 retry IS NOT NULL AND retry>max_retries THEN 'Job found dead after too many retries' diff --git a/queue_job/static/description/index.html b/queue_job/static/description/index.html index f3db6a98b1..1411ceb690 100644 --- a/queue_job/static/description/index.html +++ b/queue_job/static/description/index.html @@ -3,7 +3,7 @@ -Job Queue +README.rst -
-

Job Queue

+
+ + +Odoo Community Association + +
+

Job Queue

-

Mature License: LGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

+

Mature License: LGPL-3 OCA/queue Translate me on Weblate Try me on Runboat

This addon adds an integrated Job Queue to Odoo.

It allows to postpone method calls executed asynchronously.

Jobs are executed in the background by a Jobrunner, in their own transaction.

@@ -441,11 +446,11 @@

Job Queue

-

Installation

+

Installation

Be sure to have the requests library.

-

Configuration

+

Configuration

  • Using environment variables and command line:
    • Adjust environment variables (optional):
-

Usage

+

Usage

To use this module, you need to:

  1. Go to Job Queue menu
-

Developers

+

Developers

-

Delaying jobs

+

Delaying jobs

The fast way to enqueue a job for a method is to use with_delay() on a record or model:

@@ -621,7 +626,7 @@ 

Delaying jobs

-

Enqueing Job Options

+

Enqueing Job Options

  • priority: default is 10, the closest it is to 0, the faster it will be executed
  • @@ -638,7 +643,7 @@

    Enqueing Job Options

-

Configure default options for jobs

+

Configure default options for jobs

In earlier versions, jobs could be configured using the @job decorator. This is now obsolete, they can be configured using optional queue.job.function and queue.job.channel XML records.

@@ -759,7 +764,7 @@

Configure default options for job without delaying any jobs.

-

Testing

+

Testing

Asserting enqueued jobs

The recommended way to test jobs, rather than running them directly and synchronously is to split the tests in two parts:

@@ -879,14 +884,14 @@

Testing

-

Tips and tricks

+

Tips and tricks

  • Idempotency (https://www.restapitutorial.com/lessons/idempotency.html): The queue_job should be idempotent so they can be retried several times without impact on the data.
  • The job should test at the very beginning its relevance: the moment the job will be executed is unknown by design. So the first task of a job should be to check if the related work is still relevant at the moment of the execution.
-

Patterns

+

Patterns

Through the time, two main patterns emerged:

  1. For data exposed to users, a model should store the data and the model should be the creator of the job. The job is kept hidden from the users
  2. @@ -896,7 +901,7 @@

    Patterns

-

Known issues / Roadmap

+

Known issues / Roadmap

  • After creating a new database or installing queue_job on an existing database, Odoo must be restarted for the runner to detect it.
  • @@ -917,7 +922,7 @@

    Known issues / Roadmap

-

Changelog

+

Changelog

-

Bug Tracker

+

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 @@ -947,16 +952,16 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Camptocamp
  • ACSONE SA/NV
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -988,5 +993,6 @@

Maintainers

+