chore: fix clippy warnings in scheduler module

This commit is contained in:
xiaoski 2026-05-05 00:31:22 +08:00
parent 5746668e36
commit 0056bfbd23
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ pub fn next_run_for_schedule(schedule: &Schedule, from: i64) -> Option<i64> {
Schedule::Every { every_ms } => Some(from + *every_ms as i64), Schedule::Every { every_ms } => Some(from + *every_ms as i64),
Schedule::Cron { expr, tz } => { Schedule::Cron { expr, tz } => {
let cron_schedule = cron::Schedule::from_str(expr.as_str()).ok()?; let cron_schedule = cron::Schedule::from_str(expr.as_str()).ok()?;
let from_secs = (from / 1000) as i64; let from_secs = from / 1000;
let from_nanos = ((from % 1000) * 1_000_000) as u32; let from_nanos = ((from % 1000) * 1_000_000) as u32;
let from_dt = Utc.timestamp_opt(from_secs, from_nanos).single()?; let from_dt = Utc.timestamp_opt(from_secs, from_nanos).single()?;

View File

@ -109,7 +109,7 @@ impl SchedulerStore {
.fetch_optional(pool) .fetch_optional(pool)
.await? .await?
.ok_or_else(|| anyhow::anyhow!("job not found: {id}"))?; .ok_or_else(|| anyhow::anyhow!("job not found: {id}"))?;
Ok(row_to_job(&row)?) row_to_job(&row)
} }
/// List all jobs, ordered by next_run_at ascending. /// List all jobs, ordered by next_run_at ascending.