mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 18:18:47 +01:00
revert: keep starting the RQ streaming worker unconditionally
Reading streaming.enabled from config.yml in the init script couples the shell to the YAML config, and the worker's isolation is what keeps a slow teardown or exit save pull off the shared task worker (#4632). The worker stays always-on; its idle cost is reduced separately by slimming what RQ worker parents import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gh1SRMfuK7BZmf6YxMqSyT
This commit is contained in:
@@ -263,7 +263,7 @@ start_bin_rq_cron() {
|
||||
# Commands to start RQ worker
|
||||
start_bin_rq_worker() {
|
||||
info_log "Starting RQ worker"
|
||||
start_rq_worker rq_worker "${RQ_WORKER_QUEUES[@]}"
|
||||
start_rq_worker rq_worker high default low
|
||||
}
|
||||
|
||||
# Scans get a worker of their own, see SCAN_QUEUE_NAME.
|
||||
@@ -414,22 +414,6 @@ fi
|
||||
# Startup process requires database and cache to be already available
|
||||
run_startup
|
||||
|
||||
# The streaming worker only runs streaming teardowns and exit save pulls. With
|
||||
# streaming off at boot (exit status 3) the general worker drains that queue
|
||||
# instead, since config.yml can turn streaming on without a restart and pulls
|
||||
# queued before it went off still need a consumer.
|
||||
RQ_WORKER_QUEUES=(high default low)
|
||||
START_STREAMING_WORKER=true
|
||||
streaming_status=0
|
||||
PYTHONPATH="/backend:${PYTHONPATH-}" python3 -c \
|
||||
'from config.config_manager import config_manager as cm; raise SystemExit(0 if cm.get_config().STREAMING_ENABLED else 3)' ||
|
||||
streaming_status=$?
|
||||
if [[ ${streaming_status} -eq 3 ]]; then
|
||||
info_log "Streaming is disabled, the RQ worker takes the streaming queue"
|
||||
START_STREAMING_WORKER=false
|
||||
RQ_WORKER_QUEUES+=(streaming)
|
||||
fi
|
||||
|
||||
# main loop
|
||||
while ! ((exited)); do
|
||||
watchdog_process_pid gunicorn
|
||||
@@ -441,9 +425,7 @@ while ! ((exited)); do
|
||||
|
||||
watchdog_process_pid rq_scan_worker
|
||||
|
||||
if [[ ${START_STREAMING_WORKER} == "true" ]]; then
|
||||
watchdog_process_pid rq_streaming_worker
|
||||
fi
|
||||
watchdog_process_pid rq_streaming_worker
|
||||
|
||||
# only start the watcher if enabled
|
||||
if [[ ${ENABLE_RESCAN_ON_FILESYSTEM_CHANGE} == "true" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user