fix: do not handle zombie jobs on initial_load of monitor db

This commit is contained in:
Ruben Fiszel
2024-02-25 20:37:33 +01:00
parent b5c4f4b6d0
commit 86ca005c54
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -300,7 +300,7 @@ Windmill Community Edition {GIT_VERSION}
initial_load(&db, killpill_tx.clone(), worker_mode, server_mode).await;
monitor_db(&db, &base_internal_url, rsmq.clone(), server_mode).await;
monitor_db(&db, &base_internal_url, rsmq.clone(), server_mode, true).await;
monitor_pool(&db).await;
@@ -377,6 +377,7 @@ Windmill Community Edition {GIT_VERSION}
&base_internal_url,
rsmq.clone(),
server_mode,
false
)
.await;
},
+4 -3
View File
@@ -571,9 +571,10 @@ pub async fn monitor_db(
base_internal_url: &str,
rsmq: Option<MultiplexedRsmq>,
server_mode: bool,
initial_load: bool,
) {
let zombie_jobs_f = async {
if server_mode {
if server_mode && !initial_load {
handle_zombie_jobs(db, base_internal_url, rsmq.clone(), "server").await;
match handle_zombie_flows(db, rsmq.clone()).await {
Err(err) => {
@@ -584,7 +585,7 @@ pub async fn monitor_db(
}
};
let expired_items_f = async {
if server_mode {
if server_mode && !initial_load {
delete_expired_items(&db).await;
}
};
@@ -605,7 +606,7 @@ pub async fn monitor_db(
};
let expose_queue_metrics_f = async {
if METRICS_ENABLED.load(std::sync::atomic::Ordering::Relaxed) && server_mode {
if !initial_load && METRICS_ENABLED.load(std::sync::atomic::Ordering::Relaxed) && server_mode {
expose_queue_metrics(&db).await;
}
};