From 0ae753e4fe64cc7fd6eaa996af9ed196f4c97344 Mon Sep 17 00:00:00 2001 From: Ryan McClelland Date: Fri, 31 Jul 2026 12:00:21 -0700 Subject: [PATCH 1/2] fix(docker): always start the RQ scheduler The scheduler only started when one of four ENABLE_SCHEDULED_* flags was true, but nothing else respects that condition. startup.py registers the netplay, upload-tmp and zip-cache cleanups unconditionally, three more flags gate periodic tasks that are absent from the list, and the filesystem watcher defers its rescans through the scheduler as well. Any of those leaves jobs sitting in the scheduler registry with no process to run them. On a default install the three cleanups never fire at all. A watcher running with none of the four listed tasks enabled leaves a delayed scan_platforms entry that nothing will execute, and the concurrent scan guard reads it as a scan already queued, so every manual scan is refused with "A scan is already in progress". Restarting does not help, because the entry is persisted state rather than a running process. Start the scheduler unconditionally, matching entrypoint.sh, which never gated it. A stuck entry then clears on its own, since the scheduler enqueues past-due jobs as soon as it comes up. Co-Authored-By: Claude Opus 5 --- docker/init_scripts/init | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/init_scripts/init b/docker/init_scripts/init index fb8af6cff..b6374913c 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -376,10 +376,11 @@ run_startup while ! ((exited)); do watchdog_process_pid gunicorn - # only start the scheduler if enabled - if [[ ${ENABLE_SCHEDULED_RESCAN} == "true" || ${ENABLE_SCHEDULED_UPDATE_SWITCH_TITLEDB} == "true" || ${ENABLE_SCHEDULED_UPDATE_LAUNCHBOX_METADATA} == "true" || ${ENABLE_SCHEDULED_CLEANUP_ORPHANED_RESOURCES} == "true" ]]; then - watchdog_process_pid rq_scheduler - fi + # The scheduler always runs. startup.py registers the netplay, upload-tmp and + # zip-cache cleanups unconditionally, and the watcher defers its rescans + # through the scheduler, so gating it on the ENABLE_SCHEDULED_* flags left + # those jobs queued with nothing to execute them. + watchdog_process_pid rq_scheduler watchdog_process_pid rq_worker From ae74f8de5382eb5a91c41ac12c1c54a828f8f1cb Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Sat, 1 Aug 2026 11:04:36 -0400 Subject: [PATCH 2/2] chore(docker): trim the scheduler comment Co-Authored-By: Claude Opus 5 (1M context) --- docker/init_scripts/init | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docker/init_scripts/init b/docker/init_scripts/init index b6374913c..a3d48a196 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -376,10 +376,7 @@ run_startup while ! ((exited)); do watchdog_process_pid gunicorn - # The scheduler always runs. startup.py registers the netplay, upload-tmp and - # zip-cache cleanups unconditionally, and the watcher defers its rescans - # through the scheduler, so gating it on the ENABLE_SCHEDULED_* flags left - # those jobs queued with nothing to execute them. + # always run the scheduler watchdog_process_pid rq_scheduler watchdog_process_pid rq_worker