From ff9d7d6c3a287e0af1a57db28eb9e6bf852e95b3 Mon Sep 17 00:00:00 2001 From: n08i40k Date: Sun, 25 May 2025 17:39:23 +0400 Subject: [PATCH] fix(cache): fix setting cache_update_required flag in cache status --- src/routes/schedule/schema.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/schedule/schema.rs b/src/routes/schedule/schema.rs index 56158c2..4842c0a 100644 --- a/src/routes/schedule/schema.rs +++ b/src/routes/schedule/schema.rs @@ -99,7 +99,7 @@ impl From<&Schedule> for CacheStatus { fn from(value: &Schedule) -> Self { Self { cache_hash: value.hash(), - cache_update_required: (value.fetched_at - Utc::now()) > Duration::minutes(5), + cache_update_required: (Utc::now() - value.fetched_at) > Duration::minutes(5), last_cache_update: value.fetched_at.timestamp(), last_schedule_update: value.updated_at.timestamp(), }