Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[base_import_async](base_import_async/) | 18.0.1.0.0 | | Import CSV files in the background
[queue_job](queue_job/) | 18.0.1.3.0 | [![guewen](https://github.com/guewen.png?size=30px)](https://github.com/guewen) | Job Queue
[queue_job](queue_job/) | 18.0.1.4.1 | <a href='https://github.com/guewen'><img src='https://github.com/guewen.png' width='32' height='32' style='border-radius:50%;' alt='guewen'/></a> | Job Queue
[queue_job_batch](queue_job_batch/) | 18.0.1.0.0 | | Job Queue Batch
[queue_job_cron](queue_job_cron/) | 18.0.1.1.0 | | Scheduled Actions as Queue Jobs
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 18.0.1.0.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Run jobs without a dedicated JobRunner
[queue_job_cron_jobrunner](queue_job_cron_jobrunner/) | 18.0.1.0.0 | <a href='https://github.com/ivantodorovich'><img src='https://github.com/ivantodorovich.png' width='32' height='32' style='border-radius:50%;' alt='ivantodorovich'/></a> | Run jobs without a dedicated JobRunner
[queue_job_subscribe](queue_job_subscribe/) | 18.0.1.0.0 | | Control which users are subscribed to queue job notifications
[test_queue_job](test_queue_job/) | 18.0.1.0.1 | | Queue Job Tests
[test_queue_job_batch](test_queue_job_batch/) | 18.0.1.0.0 | | Test Job Queue Batch
Expand Down
8 changes: 6 additions & 2 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
@@ -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
=========
Expand All @@ -7,13 +11,13 @@ Job Queue
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3fac52655772f6aa01506c81cba64db296a7d130745d8fa74e6d9ace0d8124c7
!! source digest: sha256:fafa81e5bc8c9180e7e3b5b3b075433ecd9d068ad20f767679e747bec540328e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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
Expand Down
2 changes: 1 addition & 1 deletion queue_job/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "Job Queue",
"version": "18.0.1.3.0",
"version": "18.0.1.4.1",
"author": "Camptocamp,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/queue",
"license": "LGPL-3",
Expand Down
11 changes: 11 additions & 0 deletions queue_job/jobrunner/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ class ChannelJob:

"""

__slots__ = (
"db_name",
"channel",
"uuid",
"seq",
"date_created",
"priority",
"eta",
"__weakref__",
)

def __init__(self, db_name, channel, uuid, seq, date_created, priority, eta):
self.db_name = db_name
self.channel = channel
Expand Down
54 changes: 30 additions & 24 deletions queue_job/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Job Queue</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="job-queue">
<h1 class="title">Job Queue</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="job-queue">
<h1>Job Queue</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3fac52655772f6aa01506c81cba64db296a7d130745d8fa74e6d9ace0d8124c7
!! source digest: sha256:fafa81e5bc8c9180e7e3b5b3b075433ecd9d068ad20f767679e747bec540328e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/18.0/queue_job"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/queue/tree/18.0/queue_job"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/queue-18-0/queue-18-0-queue_job"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/queue&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon adds an integrated Job Queue to Odoo.</p>
<p>It allows to postpone method calls executed asynchronously.</p>
<p>Jobs are executed in the background by a <tt class="docutils literal">Jobrunner</tt>, in their own
Expand Down Expand Up @@ -445,11 +450,11 @@ <h1 class="title">Job Queue</h1>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
<p>Be sure to have the <tt class="docutils literal">requests</tt> library.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
<ul class="simple">
<li>Using environment variables and command line:<ul>
<li>Adjust environment variables (optional):<ul>
Expand Down Expand Up @@ -499,15 +504,15 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
</table>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to <tt class="docutils literal">Job Queue</tt> menu</li>
</ol>
<div class="section" id="developers">
<h2><a class="toc-backref" href="#toc-entry-4">Developers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Developers</a></h3>
<div class="section" id="delaying-jobs">
<h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3>
<h4><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h4>
<p>The fast way to enqueue a job for a method is to use <tt class="docutils literal">with_delay()</tt> on
a record or model:</p>
<pre class="code python literal-block">
Expand Down Expand Up @@ -627,7 +632,7 @@ <h3><a class="toc-backref" href="#toc-entry-5">Delaying jobs</a></h3>
</pre>
</div>
<div class="section" id="enqueing-job-options">
<h3><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h3>
<h4><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h4>
<ul class="simple">
<li>priority: default is 10, the closest it is to 0, the faster it will be
executed</li>
Expand All @@ -646,7 +651,7 @@ <h3><a class="toc-backref" href="#toc-entry-6">Enqueing Job Options</a></h3>
</ul>
</div>
<div class="section" id="configure-default-options-for-jobs">
<h3><a class="toc-backref" href="#toc-entry-7">Configure default options for jobs</a></h3>
<h4><a class="toc-backref" href="#toc-entry-7">Configure default options for jobs</a></h4>
<p>In earlier versions, jobs could be configured using the <tt class="docutils literal">&#64;job</tt>
decorator. This is now obsolete, they can be configured using optional
<tt class="docutils literal">queue.job.function</tt> and <tt class="docutils literal">queue.job.channel</tt> XML records.</p>
Expand Down Expand Up @@ -774,7 +779,7 @@ <h3><a class="toc-backref" href="#toc-entry-7">Configure default options for job
delaying any jobs.</p>
</div>
<div class="section" id="testing">
<h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
<h4><a class="toc-backref" href="#toc-entry-8">Testing</a></h4>
<p><strong>Asserting enqueued jobs</strong></p>
<p>The recommended way to test jobs, rather than running them directly and
synchronously is to split the tests in two parts:</p>
Expand Down Expand Up @@ -889,7 +894,7 @@ <h3><a class="toc-backref" href="#toc-entry-8">Testing</a></h3>
synchronously</p>
</div>
<div class="section" id="tips-and-tricks">
<h3><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h3>
<h4><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h4>
<ul class="simple">
<li><strong>Idempotency</strong>
(<a class="reference external" href="https://www.restapitutorial.com/lessons/idempotency.html">https://www.restapitutorial.com/lessons/idempotency.html</a>): The
Expand All @@ -902,7 +907,7 @@ <h3><a class="toc-backref" href="#toc-entry-9">Tips and tricks</a></h3>
</ul>
</div>
<div class="section" id="patterns">
<h3><a class="toc-backref" href="#toc-entry-10">Patterns</a></h3>
<h4><a class="toc-backref" href="#toc-entry-10">Patterns</a></h4>
<p>Through the time, two main patterns emerged:</p>
<ol class="arabic simple">
<li>For data exposed to users, a model should store the data and the
Expand All @@ -916,7 +921,7 @@ <h3><a class="toc-backref" href="#toc-entry-10">Patterns</a></h3>
</div>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h1>
<h2><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h2>
<ul class="simple">
<li>After creating a new database or installing <tt class="docutils literal">queue_job</tt> on an
existing database, Odoo must be restarted for the runner to detect it.</li>
Expand All @@ -937,9 +942,9 @@ <h1><a class="toc-backref" href="#toc-entry-11">Known issues / Roadmap</a></h1>
</pre>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#toc-entry-12">Changelog</a></h1>
<h2><a class="toc-backref" href="#toc-entry-12">Changelog</a></h2>
<div class="section" id="next">
<h2><a class="toc-backref" href="#toc-entry-13">Next</a></h2>
<h3><a class="toc-backref" href="#toc-entry-13">Next</a></h3>
<ul class="simple">
<li>[ADD] Run jobrunner as a worker process instead of a thread in the
main process (when running with –workers &gt; 0)</li>
Expand All @@ -950,24 +955,24 @@ <h2><a class="toc-backref" href="#toc-entry-13">Next</a></h2>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-14">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-14">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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20queue_job%0Aversion:%2018.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>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-15">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-15">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-16">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-16">Authors</a></h3>
<ul class="simple">
<li>Camptocamp</li>
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-17">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-17">Contributors</a></h3>
<ul class="simple">
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Stéphane Bidoul &lt;<a class="reference external" href="mailto:stephane.bidoul&#64;acsone.eu">stephane.bidoul&#64;acsone.eu</a>&gt;</li>
Expand All @@ -987,12 +992,12 @@ <h2><a class="toc-backref" href="#toc-entry-17">Contributors</a></h2>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-18">Other credits</a></h2>
<h3><a class="toc-backref" href="#toc-entry-18">Other credits</a></h3>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-19">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-19">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" />
Expand All @@ -1007,5 +1012,6 @@ <h2><a class="toc-backref" href="#toc-entry-19">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>