Skip to content
Open
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
8 changes: 6 additions & 2 deletions queue_job/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Configuration
``--http-interface`` or ``localhost`` if unset
- ``ODOO_QUEUE_JOB_HTTP_AUTH_USER=jobrunner``, default empty
- ``ODOO_QUEUE_JOB_HTTP_AUTH_PASSWORD=s3cr3t``, default empty
- ``QUEUE_JOB__NO_DELAY=1``, disables the queue for testing purposes
- Start Odoo with ``--load=web,queue_job`` and ``--workers`` greater
than 1. [1]_

Expand All @@ -125,6 +126,7 @@ Configuration
port = 443
http_auth_user = jobrunner
http_auth_password = s3cr3t
queue_job__no_delay=True # disables the queue

- Confirm the runner is starting correctly by checking the odoo log
file:
Expand Down Expand Up @@ -451,7 +453,8 @@ running Odoo**
When you are developing (ie: connector modules) you might want to bypass
the queue job and run your code immediately.

To do so you can set QUEUE_JOB\__NO_DELAY=1 in your environment.
To do so you can set QUEUE_JOB\__NO_DELAY=1 in your environment, or
include queue_job\__no_delay=True in your Odoo server configuration.

**Bypass jobs in tests**

Expand Down Expand Up @@ -569,7 +572,8 @@ calling ``jobs_tester.perform_enqueued_jobs()`` in your test.
When you are developing (ie: connector modules) you might want to bypass
the queue job and run your code immediately.

To do so you can set ``QUEUE_JOB__NO_DELAY=1`` in your environment.
To do so you can set ``QUEUE_JOB__NO_DELAY=1`` in your environment, or
include queue_job\__no_delay=True in your Odoo server configuration.

Warning

Expand Down
2 changes: 2 additions & 0 deletions queue_job/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
or `localhost` if unset
- `ODOO_QUEUE_JOB_HTTP_AUTH_USER=jobrunner`, default empty
- `ODOO_QUEUE_JOB_HTTP_AUTH_PASSWORD=s3cr3t`, default empty
- `QUEUE_JOB__NO_DELAY=1`, disables the queue for testing purposes
- Start Odoo with `--load=web,queue_job` and `--workers` greater than
1.[^1]
- Using the Odoo configuration file:
Expand All @@ -26,6 +27,7 @@ host = load-balancer
port = 443
http_auth_user = jobrunner
http_auth_password = s3cr3t
queue_job__no_delay=True # disables the queue
```

- Confirm the runner is starting correctly by checking the odoo log
Expand Down
6 changes: 4 additions & 2 deletions queue_job/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ running Odoo**
When you are developing (ie: connector modules) you might want to bypass
the queue job and run your code immediately.

To do so you can set QUEUE_JOB\_\_NO_DELAY=1 in your environment.
To do so you can set QUEUE_JOB\_\_NO_DELAY=1 in your environment,
or include queue_job__no_delay=True in your Odoo server configuration.

**Bypass jobs in tests**

Expand Down Expand Up @@ -407,7 +408,8 @@ def test_method_to_test(self):
When you are developing (ie: connector modules) you might want to bypass
the queue job and run your code immediately.

To do so you can set `QUEUE_JOB__NO_DELAY=1` in your environment.
To do so you can set `QUEUE_JOB__NO_DELAY=1` in your environment,
or include queue_job__no_delay=True in your Odoo server configuration.

Warning

Expand Down
6 changes: 6 additions & 0 deletions queue_job/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import logging
import os

from .jobrunner import queue_job_config

_logger = logging.getLogger(__name__)


Expand All @@ -19,3 +21,7 @@ def must_run_without_delay(env):
if env.context.get("queue_job__no_delay"):
_logger.info("`queue_job__no_delay` ctx key found. NO JOB scheduled.")
return True

if queue_job_config.get("queue_job__no_delay"):
_logger.info("`queue_job__no_delay` server config found. NO JOB scheduled.")
return True