mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-23 16:00:38 +00:00
error for flow of length 0
This commit is contained in:
@@ -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! {
|
||||
|
||||
@@ -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::<FlowValue>(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,
|
||||
|
||||
Reference in New Issue
Block a user