|
| 1 | +#[derive(Debug, clap::Subcommand)] |
| 2 | +pub(crate) enum CronCommand { |
| 3 | + /// Run one cron scheduler tick (process due jobs once) |
| 4 | + Tick { |
| 5 | + /// Max due jobs to execute in this tick |
| 6 | + #[arg(long, default_value_t = 20)] |
| 7 | + max_due_per_tick: usize, |
| 8 | + /// Max catch-up slots per job when recovering after downtime |
| 9 | + #[arg(long, default_value_t = 25)] |
| 10 | + max_catchup_slots_per_job: u32, |
| 11 | + /// Auto-disable a job after this many consecutive failures |
| 12 | + #[arg(long, default_value_t = 5)] |
| 13 | + max_consecutive_errors: u32, |
| 14 | + /// Minimum delay (seconds) before retrying a failing job |
| 15 | + #[arg(long, default_value_t = 30)] |
| 16 | + min_retry_delay_secs: u64, |
| 17 | + /// Per-job execution timeout (milliseconds) |
| 18 | + #[arg(long, default_value_t = 10_000)] |
| 19 | + job_timeout_ms: u64, |
| 20 | + }, |
| 21 | + /// Run a long-lived cron worker loop |
| 22 | + Worker { |
| 23 | + /// Seconds between scheduler ticks |
| 24 | + #[arg(long, default_value_t = 2)] |
| 25 | + interval_secs: u64, |
| 26 | + /// Max due jobs to execute per tick |
| 27 | + #[arg(long, default_value_t = 20)] |
| 28 | + max_due_per_tick: usize, |
| 29 | + /// Max catch-up slots per job when recovering after downtime |
| 30 | + #[arg(long, default_value_t = 25)] |
| 31 | + max_catchup_slots_per_job: u32, |
| 32 | + /// Auto-disable a job after this many consecutive failures |
| 33 | + #[arg(long, default_value_t = 5)] |
| 34 | + max_consecutive_errors: u32, |
| 35 | + /// Minimum delay (seconds) before retrying a failing job |
| 36 | + #[arg(long, default_value_t = 30)] |
| 37 | + min_retry_delay_secs: u64, |
| 38 | + /// Per-job execution timeout (milliseconds) |
| 39 | + #[arg(long, default_value_t = 10_000)] |
| 40 | + job_timeout_ms: u64, |
| 41 | + }, |
| 42 | +} |
0 commit comments