Skip to content

Commit

Permalink
fix: fail on non-integer sleep value (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
invakid404 committed Nov 3, 2023
1 parent 0fcebe4 commit 6f47b96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/windmill-worker/src/worker_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,11 @@ async fn push_next_flow_job<R: rsmq_async::RsmqConnection + Send + Sync + Clone>
};
match json_value {
Ok(serde_json::Value::Number(n)) => {
n.as_u64().map(|x| from_now(Duration::from_secs(x)))
if n.is_u64() {
n.as_u64().map(|x| from_now(Duration::from_secs(x)))
} else {
Err(Error::ExecutionErr(format!("Expected an integer, found: {n}")))
}
}
_ => Err(Error::ExecutionErr(format!(
"Expected a number value, found: {json_value:?}"
Expand Down

0 comments on commit 6f47b96

Please sign in to comment.