Skip to main content

all_overdue_jobs

Function all_overdue_jobs 

pub fn all_overdue_jobs(
    config: &Config,
    now: DateTime<Utc>,
) -> Result<Vec<CronJob>, Error>
Expand description

Every overdue row, including rows with no single owner, because the two startup modes need the unfiltered view for different reasons.

With catch_up_on_startup disabled, startup skips or advances missed occurrences: an unowned one-shot has to be visible here to be retired or advanced, rather than staying overdue until a claim appears and the stale occurrence fires.

With catch-up enabled, the row is surfaced and then refused by the dispatch guard, which releases its lock; it stays overdue until ownership becomes resolvable. That is the intended behavior for enabled catch-up, and it cannot execute meanwhile: due_jobs excludes it from ordinary polling and every execution path refuses an unowned row.