diff --git a/docker/init_scripts/init b/docker/init_scripts/init index a3d48a196..a1f4bb4a3 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -251,15 +251,18 @@ start_bin_rq_worker() { fi # Set PYTHONPATH so RQ can find the tasks module. + # The connection URL goes through RQ_REDIS_URL rather than --url, so the + # embedded password stays out of the worker's world-readable command line. # Use a worker class that drops the noisy per-sweep "cleaning registries for # queue" log line. The maintenance interval keeps its default (~10 min) so # orphaned STARTED jobs and stale workers are still pruned promptly, which the # watcher's Worker.all() scan dedupe relies on. - PYTHONPATH="/backend:${PYTHONPATH-}" rq worker \ + PYTHONPATH="/backend:${PYTHONPATH-}" \ + RQ_REDIS_URL="${redis_url}" \ + rq worker \ --path /backend \ --worker-class handler.rq_worker.RomMWorker \ --pid /tmp/rq_worker.pid \ - --url "${redis_url}" \ --results-ttl "${TASK_RESULT_TTL:-86400}" \ --logging_level "${LOGLEVEL}" \ high default low & diff --git a/entrypoint.sh b/entrypoint.sh index 74ecd13d5..e815271bb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -69,15 +69,18 @@ else fi # Set PYTHONPATH so RQ can find the tasks module. +# The connection URL goes through RQ_REDIS_URL rather than --url, so the +# embedded password stays out of the worker's world-readable command line. # Use a worker class that drops the noisy per-sweep "cleaning registries for # queue" log line. The maintenance interval keeps its default (~10 min) so # orphaned STARTED jobs and stale workers are still pruned promptly, which the # watcher's Worker.all() scan dedupe relies on. -PYTHONPATH="/app/backend:${PYTHONPATH-}" rq worker \ +PYTHONPATH="/app/backend:${PYTHONPATH-}" \ + RQ_REDIS_URL="${REDIS_URL}" \ + rq worker \ --path /app/backend \ --worker-class handler.rq_worker.RomMWorker \ --pid /tmp/rq_worker.pid \ - --url "${REDIS_URL}" \ --logging_level "${LOGLEVEL:-INFO}" \ high default low &