From 2436380ec9ccd965f4406d9587ff72b3fc1f4eeb Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Tue, 23 Sep 2025 16:49:56 +0800 Subject: [PATCH] fix(job): utilize to_std err to check whether the time is past --- .../src/service/background_job/helper/cron.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ee/tabby-webserver/src/service/background_job/helper/cron.rs b/ee/tabby-webserver/src/service/background_job/helper/cron.rs index 4f24a0d9fc62..425256f2020e 100644 --- a/ee/tabby-webserver/src/service/background_job/helper/cron.rs +++ b/ee/tabby-webserver/src/service/background_job/helper/cron.rs @@ -35,14 +35,10 @@ where match next { Some(next) => { let to_sleep = next.clone() - timezone.from_utc_datetime(&Utc::now().naive_utc()); - if to_sleep.num_seconds() < 0 { - // If the next time is in the past, skip it and get the next one. - continue - } let to_sleep = match to_sleep.to_std() { Ok(to_sleep) => to_sleep, - Err(err) => { - warn!("Failed to convert to std duration: {}", err); + Err(_) => { + // If the next time is in the past or conversion fails, skip it and get the next one. continue; } };