Skip to content

Commit 70cf079

Browse files
committed
feat: migrate from OCA queue_job to job_worker
Replace queue_job dependency with job_worker across all spp_* modules. - Update __manifest__.py depends in 7 modules - Replace all odoo.addons.queue_job imports with job_worker - Delete queue.job.channel XML data and Python model - Add queue.limit data files for spp_area and spp_dci_server - Migrate spp_programs queue_data.xml to queue.limit records - Update test contexts from test_queue_job_no_delay to queue_job__no_delay - Update menu/action references to job_worker external IDs - Update lint scripts to whitelist job_worker model names - Update Docker and pre-commit config for job_worker
1 parent 5ac7496 commit 70cf079

67 files changed

Lines changed: 153 additions & 202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ concurrency:
3030
cancel-in-progress: true
3131

3232
env:
33-
ODOO_ADDONS_PATH: /opt/odoo/odoo/addons,/opt/odoo/odoo/odoo/addons,/mnt/extra-addons/openspp,/mnt/extra-addons/server-ux,/mnt/extra-addons/server-tools,/mnt/extra-addons/queue,/mnt/extra-addons/server-backend,/mnt/extra-addons/rest-framework,/mnt/extra-addons/muk-it
33+
ODOO_ADDONS_PATH: /opt/odoo/odoo/addons,/opt/odoo/odoo/odoo/addons,/mnt/extra-addons/openspp,/mnt/extra-addons/server-ux,/mnt/extra-addons/server-tools,/mnt/extra-addons/queue,/mnt/extra-addons/odoo-job-worker,/mnt/extra-addons/server-backend,/mnt/extra-addons/rest-framework,/mnt/extra-addons/muk-it
3434

3535
jobs:
3636
# ============================================================================

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
env:
20-
ODOO_ADDONS_PATH: /opt/odoo/odoo/addons,/opt/odoo/odoo/odoo/addons,/mnt/extra-addons/openspp,/mnt/extra-addons/server-ux,/mnt/extra-addons/server-tools,/mnt/extra-addons/queue,/mnt/extra-addons/server-backend,/mnt/extra-addons/rest-framework,/mnt/extra-addons/muk-it
20+
ODOO_ADDONS_PATH: /opt/odoo/odoo/addons,/opt/odoo/odoo/odoo/addons,/mnt/extra-addons/openspp,/mnt/extra-addons/server-ux,/mnt/extra-addons/server-tools,/mnt/extra-addons/queue,/mnt/extra-addons/odoo-job-worker,/mnt/extra-addons/server-backend,/mnt/extra-addons/rest-framework,/mnt/extra-addons/muk-it
2121

2222
jobs:
2323
# ============================================================================

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ repos:
178178
- PyYAML
179179
types: [python]
180180
# Exclude: scripts, tests, migrations, and third-party modules
181-
exclude: ^scripts/|/tests/|migrations/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
181+
exclude: ^scripts/|/tests/|migrations/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
182182
pass_filenames: true
183183
- id: openspp-check-xml-ids
184184
name: "OpenSPP: XML ID naming conventions"
@@ -189,7 +189,7 @@ repos:
189189
- PyYAML
190190
types: [xml]
191191
# Exclude: scripts, tests, data, demo, and third-party modules
192-
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
192+
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
193193
pass_filenames: true
194194
# Phase 2: ACL check (warning only, runs on all files)
195195
- id: openspp-check-acl
@@ -222,7 +222,7 @@ repos:
222222
- PyYAML
223223
types: [python]
224224
# Exclude: scripts, tests, migrations, and third-party modules
225-
exclude: ^scripts/|/tests/|migrations/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
225+
exclude: ^scripts/|/tests/|migrations/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
226226
pass_filenames: true
227227
# Phase 3: Logger setup check (warning only)
228228
- id: openspp-check-logger
@@ -234,7 +234,7 @@ repos:
234234
- PyYAML
235235
types: [python]
236236
# Exclude: scripts, tests, manifests, inits, and third-party modules
237-
exclude: ^scripts/|/tests/|__manifest__|__init__|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
237+
exclude: ^scripts/|/tests/|__manifest__|__init__|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
238238
pass_filenames: true
239239
# Phase 3: UI patterns check (warning only)
240240
- id: openspp-check-ui
@@ -248,7 +248,7 @@ repos:
248248
- PyYAML
249249
types: [xml]
250250
# Exclude: scripts, tests, data, demo, and third-party modules
251-
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
251+
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
252252
pass_filenames: true
253253
# Odoo 19 Compatibility Checks
254254
- id: openspp-check-odoo19-python
@@ -260,7 +260,7 @@ repos:
260260
- PyYAML
261261
types: [python]
262262
# Exclude: scripts, tests, migrations, and third-party modules
263-
exclude: ^scripts/|/tests/|migrations/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
263+
exclude: ^scripts/|/tests/|migrations/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
264264
pass_filenames: true
265265
- id: openspp-check-odoo19-xml
266266
name: "OpenSPP: Odoo 19 compatibility (XML)"
@@ -272,7 +272,7 @@ repos:
272272
- lxml
273273
types: [xml]
274274
# Exclude: scripts, tests, data, demo, and third-party modules
275-
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|queue_job|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
275+
exclude: ^scripts/|/tests/|/data/|/demo/|^(fastapi|job_worker|base_user_role|extendable|extendable_fastapi|endpoint_route_handler)/
276276
pass_filenames: true
277277
# API authentication enforcement
278278
- id: openspp-check-api-auth

.semgrep/odoo-security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ rules:
355355
...
356356
message: |
357357
cr.commit() inside a loop can cause partial data states on failure.
358-
Use queue_job for batch operations or handle transactions properly.
358+
Use job_worker for batch operations or handle transactions properly.
359359
severity: WARNING
360360
languages: [python]
361361
metadata:

docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ services:
8989
ODOO_WORKERS: "0"
9090
ODOO_CRON_THREADS: "0"
9191

92-
# Job queue configuration (defaults to "root:2")
93-
# ODOO_QUEUE_JOB_CHANNELS: "root:4"
94-
9592
# Modules to initialize (configurable via env)
9693
# For E2E: ODOO_INIT_MODULES=spp_mis_demo_v2
9794
# For UI dev: ODOO_INIT_MODULES=spp_base (or your module)

docker/.env.production.example

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ DB_SSLMODE=prefer
6060
# Number of Odoo workers (rule: (CPU cores * 2) + 1; ~1 worker per 6 concurrent users)
6161
ODOO_WORKERS=2
6262

63-
# Queue job concurrent channels
64-
ODOO_QUEUE_JOB_CHANNELS=root:2
65-
6663
# Memory limits (Docker format: 512M, 1G, 2G, etc.)
6764
ODOO_MEMORY_LIMIT=4G
6865
ODOO_MEMORY_RESERVATION=2G

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ RUN --mount=type=cache,target=/tmp/downloads,sharing=locked \
112112
download_module "OCA/server-ux" "server-ux"; \
113113
download_module "OCA/server-tools" "server-tools"; \
114114
download_module "OCA/queue" "queue"; \
115+
download_module "OpenSPP/odoo-job-worker" "odoo-job-worker"; \
115116
download_module "OCA/server-backend" "server-backend"; \
116117
download_module "OCA/rest-framework" "rest-framework"; \
117118
download_module "muk-it/odoo-modules" "muk-it"

docker/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,14 @@ docker compose -f docker/docker-compose.production.yml exec clamav clamscan --ve
190190

191191
### Performance
192192

193-
| Variable | Default | Description |
194-
| ------------------------- | ---------- | ------------------------------------- |
195-
| `ODOO_WORKERS` | 2 | Number of worker processes |
196-
| `ODOO_CRON_THREADS` | 1 | Number of cron threads |
197-
| `ODOO_MEMORY_SOFT` | 2147483648 | Soft memory limit per worker (bytes) |
198-
| `ODOO_MEMORY_HARD` | 2684354560 | Hard memory limit per worker (bytes) |
199-
| `ODOO_TIME_CPU` | 600 | CPU time limit per request (seconds) |
200-
| `ODOO_TIME_REAL` | 1200 | Real time limit per request (seconds) |
201-
| `ODOO_QUEUE_JOB_CHANNELS` | root:2 | Concurrent background jobs |
193+
| Variable | Default | Description |
194+
| ------------------- | ---------- | ------------------------------------- |
195+
| `ODOO_WORKERS` | 2 | Number of worker processes |
196+
| `ODOO_CRON_THREADS` | 1 | Number of cron threads |
197+
| `ODOO_MEMORY_SOFT` | 2147483648 | Soft memory limit per worker (bytes) |
198+
| `ODOO_MEMORY_HARD` | 2684354560 | Hard memory limit per worker (bytes) |
199+
| `ODOO_TIME_CPU` | 600 | CPU time limit per request (seconds) |
200+
| `ODOO_TIME_REAL` | 1200 | Real time limit per request (seconds) |
202201

203202
### Logging
204203

docker/docker-compose.production.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ services:
252252
memory: ${ODOO_MEMORY_RESERVATION:-2G}
253253

254254
# ==========================================================================
255-
# Queue Worker - Background job processing (OCA/queue_job)
255+
# Queue Worker - Background job processing (job_worker)
256256
# ==========================================================================
257257
queue-worker:
258258
image: ${OPENSPP_IMAGE:-ghcr.io/openspp/openspp:latest}
@@ -275,17 +275,10 @@ services:
275275
DB_SSLMODE: ${DB_SSLMODE:-prefer}
276276
ODOO_ADMIN_PASSWD: ${ODOO_ADMIN_PASSWD:?ODOO_ADMIN_PASSWD is required}
277277

278-
# Queue worker mode - no HTTP, just process jobs
279-
ODOO_WORKERS: "0"
280-
ODOO_CRON_THREADS: "0"
281-
282-
# Queue job channels (number of concurrent jobs)
283-
QUEUE_JOB_CHANNELS: ${QUEUE_JOB_CHANNELS:-2}
284-
285278
# Logging
286279
LOG_LEVEL: ${LOG_LEVEL:-info}
287-
# Override command to run queue job worker
288-
command: ["odoo", "gevent", "--limit-time-real=0"]
280+
# Run job_worker standalone runner process
281+
command: ["python", "-m", "odoo.addons.job_worker.cli"]
289282
volumes:
290283
- odoo_data:/var/lib/odoo
291284
- odoo_addons:/mnt/extra-addons

docker/entrypoint.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ export ODOO_TIME_REAL="${ODOO_TIME_REAL:-1200}"
175175
export ODOO_LIMIT_REQUEST="${ODOO_LIMIT_REQUEST:-8192}"
176176
[[ -z "$ODOO_LIMIT_REQUEST" || ! "$ODOO_LIMIT_REQUEST" =~ ^[0-9]+$ ]] && export ODOO_LIMIT_REQUEST="8192"
177177

178-
# Queue Job configuration (OCA/queue)
179-
export ODOO_QUEUE_JOB_CHANNELS="${ODOO_QUEUE_JOB_CHANNELS:-root:2}"
180-
[[ -z "$ODOO_QUEUE_JOB_CHANNELS" || ! "$ODOO_QUEUE_JOB_CHANNELS" =~ ^[a-zA-Z_][a-zA-Z0-9_.]*:[0-9]+(,[a-zA-Z_][a-zA-Z0-9_.]*:[0-9]+)*$ ]] && export ODOO_QUEUE_JOB_CHANNELS="root:2"
181-
182178
# Logging
183179
export LOG_LEVEL="${LOG_LEVEL:-info}"
184180
export LOG_HANDLER="${LOG_HANDLER:-:INFO}"

0 commit comments

Comments
 (0)