apalis_cron/error.rs
1use std::time::Duration;
2
3/// Represents an error emitted by `CronScheduler` polling
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 /// The cron scheduler might not always be polled consistently, such as when the worker is blocked.
7 /// If polling is delayed, some ticks may be skipped. When this occurs, an out-of-range error is triggered
8 /// because the missed tick is now in the past.
9 #[error("Tick out of range for {tick:?} (past duration: {duration:?})")]
10 OutOfRange {
11 /// The past duration
12 duration: Duration,
13 /// The missed tick
14 tick: u64,
15 },
16}