- storage/scheduler.rs: ScheduledJob/JobRun types + CRUD on Storage - tools/cron.rs: 6 cron agent tools (add/list/remove/enable/disable/update) - scheduler/types.rs: keep only Schedule enum - scheduler/mod.rs: use Arc<Storage> instead of raw SqlitePool - gateway/mod.rs: inject Storage directly, replace pool field - storage/mod.rs: scheduler tables in init_schema
17 lines
608 B
Rust
17 lines
608 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
/// How a job is scheduled. Serialized as JSON in the database `schedule` column.
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
#[serde(tag = "type")]
|
|
pub enum Schedule {
|
|
/// One-shot: fires once at a specific Unix millisecond timestamp, then disables.
|
|
#[serde(rename = "at")]
|
|
At { at: i64 },
|
|
/// Recurring: fires every `every_ms` milliseconds.
|
|
#[serde(rename = "every")]
|
|
Every { every_ms: u64 },
|
|
/// Recurring: fires on a cron schedule with optional timezone.
|
|
#[serde(rename = "cron")]
|
|
Cron { expr: String, tz: Option<String> },
|
|
}
|