add disable_jobs_monitoring_env_variable

This commit is contained in:
Ruben Fiszel
2025-03-30 00:12:27 +00:00
parent 3d3250194d
commit 45a6d5934e
+5 -1
View File
@@ -107,6 +107,10 @@ lazy_static::lazy_static! {
.and_then(|x| x.parse::<bool>().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::<bool>().ok())
.unwrap_or(false);
static ref QUEUE_COUNT_TAGS: Arc<RwLock<Vec<String>>> = 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) => {