From 0fef44ce0ed182ff038b9923e791ff7584622f45 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 22 Jun 2024 23:24:40 +0200 Subject: [PATCH] Fix constant name --- geneit_backend/src/constants.rs | 3 ++- geneit_backend/src/models.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/geneit_backend/src/constants.rs b/geneit_backend/src/constants.rs index e115515..e7a0f3d 100644 --- a/geneit_backend/src/constants.rs +++ b/geneit_backend/src/constants.rs @@ -147,4 +147,5 @@ pub const THUMB_HEIGHT: u32 = 350; pub const ACCOMMODATIONS_RESERVATIONS_CALENDARS_TOKENS_LEN: usize = 50; /// Minimum interval before calendar used time update -pub const CAL_URL_TIME_USED_UPDATE_MIN_INTERVAL: Duration = Duration::from_secs(60); +pub const ACCOMMODATIONS_RESERVATIONS_CAL_URL_TIME_USED_UPDATE_MIN_INTERVAL: Duration = + Duration::from_secs(60); diff --git a/geneit_backend/src/models.rs b/geneit_backend/src/models.rs index 0ccc0a6..05e8ad6 100644 --- a/geneit_backend/src/models.rs +++ b/geneit_backend/src/models.rs @@ -579,7 +579,9 @@ impl AccommodationReservationCalendar { } pub fn should_update_last_used(&self) -> bool { - (self.time_used + constants::CAL_URL_TIME_USED_UPDATE_MIN_INTERVAL.as_secs() as i64) + (self.time_used + + constants::ACCOMMODATIONS_RESERVATIONS_CAL_URL_TIME_USED_UPDATE_MIN_INTERVAL.as_secs() + as i64) < time() as i64 } }