qrush_engine/cron/
cron_job.rs1use async_trait::async_trait;
3use serde::{Deserialize, Serialize};
4use crate::job::Job;
5#[async_trait]
9pub trait CronJob: Job + Send + Sync {
10 fn cron_expression(&self) -> &'static str;
12
13 fn cron_id(&self) -> &'static str;
15
16 fn enabled(&self) -> bool {
18 true
19 }
20
21 fn timezone(&self) -> &'static str {
23 "UTC"
24 }
25}
26
27#[derive(Debug, Serialize, Deserialize, Clone)]
29pub struct CronJobMeta {
30 pub id: String,
31 pub name: String,
32 pub queue: String,
33 pub cron_expression: String,
34 pub timezone: String,
35 pub enabled: bool,
36 #[serde(default)]
38 pub last_run: Option<String>,
39 pub next_run: String,
40 pub created_at: String,
41 pub payload: String, }