fix: say nothing about a schedule that was configured to skip runs

This commit is contained in:
hugocasa
2026-08-28 16:07:40 +02:00
parent b137ee2118
commit 2b0eaf1404
2 changed files with 8 additions and 9 deletions
+4 -2
View File
@@ -1224,8 +1224,10 @@ async fn fetch_interval_drift(
w_id: &str,
schedule: &Schedule,
) -> Result<Option<IntervalDrift>> {
// A schedule that is off is not running behind, it is not running.
if !schedule.enabled {
// A schedule that is off is not running behind, it is not running. Nor is one
// told to skip: a skip handler and `no_flow_overlap` both exist to drop runs, so
// for those two the cadence the cron asks for was never the promise.
if !schedule.enabled || schedule.no_flow_overlap || schedule.dynamic_skip.is_some() {
return Ok(None);
}
// Query plan: `(workspace_id, runnable_path, created_at DESC)` index, hence the
@@ -138,15 +138,12 @@
| { interval: ScheduleIntervalDrift; queuesNextRunAtStart: boolean }
| undefined = $state(undefined)
// A flow queues its next run when the previous one starts, and so does a script
// carrying a skip handler, which is pushed as a single step flow. A retry policy
// does not: it is materialized natively onto a plain script job.
// A flow queues its next run when the previous one starts, where a script queues it
// once the previous one has finished, and the two have different ways out. Only
// those two reach here: a schedule set to skip runs is not measured at all.
function readDeployedDrift(deployed: Record<string, any>) {
deployedDrift = deployed.interval_drift
? {
interval: deployed.interval_drift,
queuesNextRunAtStart: !!deployed.is_flow || deployed.dynamic_skip != undefined
}
? { interval: deployed.interval_drift, queuesNextRunAtStart: !!deployed.is_flow }
: undefined
}
let tag: string | undefined = $state(undefined)