From 3cede5ba0796b7b935215a441b81d3b191183ecc Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Fri, 8 Aug 2025 21:32:52 -0400 Subject: [PATCH] Add scheduler disable flag to troubleshoot timeout issue - Add DISABLE_SCHEDULER environment variable to disable scheduler - Set DISABLE_SCHEDULER=true in deployment to test if scheduler is causing hangs - This is a temporary fix to isolate the problem russell@unturf.com is the boss --- .gitlab-ci.yml | 2 +- app.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ee1da3..1eeb511 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,7 +63,7 @@ deploy: [Service] WorkingDirectory=${APP_DIR} - Environment="PATH=${VENV_DIR}/bin" + Environment="PATH=${VENV_DIR}/bin" "DISABLE_SCHEDULER=true" ExecStart=${VENV_DIR}/bin/uwsgi \\ --master \\ --enable-threads \\ diff --git a/app.py b/app.py index da5e29a..137b968 100644 --- a/app.py +++ b/app.py @@ -802,6 +802,13 @@ def scheduler_worker(): def start_scheduler(): """Start the background scheduler.""" global scheduler_thread, scheduler_running + + # Check if scheduler is disabled via environment variable + disable_scheduler = os.environ.get('DISABLE_SCHEDULER', '').lower() in ('true', '1', 'yes') + if disable_scheduler: + log.info("Scheduler disabled by DISABLE_SCHEDULER environment variable") + return + if not scheduler_running: scheduler_running = True scheduler_thread = threading.Thread(target=scheduler_worker, daemon=True)