From 45a6d5934e35d1cfd452f5986caf81ebadba67af Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 30 Mar 2025 00:12:27 +0000 Subject: [PATCH] add disable_jobs_monitoring_env_variable --- backend/src/monitor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/monitor.rs b/backend/src/monitor.rs index 1209b2aca3..7454f1a7d0 100644 --- a/backend/src/monitor.rs +++ b/backend/src/monitor.rs @@ -107,6 +107,10 @@ lazy_static::lazy_static! { .and_then(|x| x.parse::().ok()) .unwrap_or(true); + pub static ref DISABLE_ZOMBIE_JOBS_MONITORING: bool = std::env::var("DISABLE_ZOMBIE_JOBS_MONITORING") + .ok() + .and_then(|x| x.parse::().ok()) + .unwrap_or(false); static ref QUEUE_COUNT_TAGS: Arc>> = Arc::new(RwLock::new(Vec::new())); @@ -1259,7 +1263,7 @@ pub async fn monitor_db( _killpill_tx: KillpillSender, ) { let zombie_jobs_f = async { - if server_mode && !initial_load { + if server_mode && !initial_load && !DISABLE_ZOMBIE_JOBS_MONITORING.load(std::sync::atomic::Ordering::Relaxed) { handle_zombie_jobs(db, base_internal_url, "server").await; match handle_zombie_flows(db).await { Err(err) => {