diff --git a/backend/src/worker.rs b/backend/src/worker.rs index d14db1b9e2..dca2c0bef9 100644 --- a/backend/src/worker.rs +++ b/backend/src/worker.rs @@ -1011,7 +1011,7 @@ pub async fn restart_zombie_jobs_periodically( loop { let restarted = sqlx::query!( "UPDATE queue SET running = false WHERE last_ping < $1 and running = true RETURNING id, workspace_id", - chrono::Utc::now() - chrono::Duration::seconds(timeout as i64 * 2) + chrono::Utc::now() - chrono::Duration::seconds(timeout as i64 * 5) ) .fetch_all(db) .await @@ -1019,7 +1019,7 @@ pub async fn restart_zombie_jobs_periodically( .unwrap_or_else(|| vec![]); for r in restarted { - tracing::info!("restarted zombie jobs {} {}", r.id, r.workspace_id); + tracing::info!("restarted zombie job {} {}", r.id, r.workspace_id); } tokio::select! { diff --git a/backend/src/worker_flow.rs b/backend/src/worker_flow.rs index a713cbe911..2f102833cb 100644 --- a/backend/src/worker_flow.rs +++ b/backend/src/worker_flow.rs @@ -365,6 +365,13 @@ pub async fn handle_flow( .ok_or_else(|| Error::InternalErr(format!("requiring a raw flow value")))? .to_owned(); let flow = serde_json::from_value::(value.to_owned())?; + + if flow.modules.len() == 0 { + Err(Error::BadRequest(format!( + "A flow needs at least one module to run" + )))?; + } + push_next_flow_job( flow_job, flow,