Axoline WebCron & Queue Worker
Run long work in the background, with channels, retries and a dead-letter queue.
A scheduled action processes pending jobs every minute. The same worker can be called from an external WebCron URL. Failed jobs wait longer after each try, then land in the dead-letter queue with the full error text.
One queue for background work: each job has a name, a channel, a priority and a state. Pending, started, done, failed, cancelled and dead letter stay visible in the same list.
What you get
Long work leaves the browser request. The user keeps working while the job waits in the queue.
Channels, priority and a start time
A job names a model method, the records it should run on, and optional arguments. A channel is a label you can filter on. A lower priority number runs first. Execute after holds the job until that time.
Growing wait, then dead letter
A failed try goes back to pending. The wait starts at 30 seconds and doubles each time, up to one hour. After the last try the job moves to the dead-letter queue. The form keeps the payload, the result and the full error text.
Cron or an external URL
Odoo’s scheduled action Axoline Queue: process jobs runs every minute. The same run can be started from a secret WebCron URL. Two workers skip a job the other one already claimed.
How a job runs
The worker takes due pending jobs, lowest priority number first, and marks them started before the method runs. One run processes a batch. The default is 20 jobs, and Settings can set that from 1 to 200.
The method runs as the user and the company stored on the job. Only a method the model lists in _axoline_queueable_methods() is accepted. Arguments have to be JSON.
From the form you can requeue a failed, dead or cancelled job, or cancel a job that is still open. An administrator can mark a started job as failed when it needs a manual decision. That failed state does not retry on its own.
WebCron by token URL
Settings show a URL of the form /axoline/queue/webcron/<token>. An external scheduler can call it with GET or POST. A wrong or missing token answers with HTTP 403 and does not run any job.
The token is created when you open the settings. New token replaces it, and the old URL stops working. The URL field has a copy button. A successful call returns JSON with how many jobs were processed, how many finished, how many failed, and how many scheduled actions are overdue.
The default number of tries is five. Settings can set it from 0 to 50. A job can also carry its own maximum.
Systray and overdue scheduled actions
Users with the Axoline Queue right see a queue icon in the top bar. It is green when there is no failed job and no overdue scheduled action. A badge counts failed jobs, including the dead letter, plus overdue scheduled actions. One failed job turns the icon red. Overdue actions alone stay yellow until there are three or more.
The menu shows pending, failed and overdue counts, and opens the matching list. The numbers refresh every minute and again when the menu opens.
Overdue crons lists active scheduled actions whose next call is more than five minutes in the past, up to 200 rows, with the delay in minutes. Administrators can open the scheduled action from that row. The list is a snapshot for that opening.
For other Axoline apps
Another app enqueues work with env['axoline.queue.job'].enqueue(...). The target model lists the allowed method names. The queue does not call an arbitrary method.
def _axoline_queueable_methods(self):
return ('action_confirm',)
self.env['axoline.queue.job'].enqueue(
'sale.order',
'action_confirm',
record_ids=orders.ids,
channel='sales',
priority=10,
)
This app does not require Enterprise Suite Core. If Suite Core is installed as well, the home screen can show the same queue status.
Installs on its own
Depends on the standard base, settings and web modules. No extra Python library. The same app runs on Odoo Community and Odoo Enterprise.
The menu is limited to the Axoline Queue right. Administrators receive that right. Enqueueing a job needs the same right.
English is the source language. Translations: German, Italian, French, Spanish (Mexico, Argentina), Dutch (Belgium), Portuguese (Brazil, Portugal).
More apps by Axoline
All modules: Axoline on the Odoo Apps Store.
Support
https://odoocommunitydemo.axoline.de/
support@axoline.de · www.axoline.de
Axoline WebCron & Queue Worker is an independent app by Axoline. It is not affiliated with, endorsed by or part of Odoo S.A. or Odoo Enterprise. Odoo is a trademark of Odoo S.A.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 1348 |
| Technical Name |
axoline_queue |
| License | OPL-1 |
| Website | https://www.axoline.de |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module