Disable memory cache expiry
All checks were successful
Fly Deploy / Deploy app (push) Successful in 2m4s

This commit is contained in:
Gabriel Simmer 2023-10-07 18:01:15 +01:00
parent 10b6b8051e
commit 429f7def5b
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ

15
src/cache/mod.rs vendored
View file

@ -17,14 +17,15 @@ pub struct CachedItem {
/// Determine whether we should actually use the cached item or not.
fn should_use(item: &CachedItem) -> bool {
let current_time: i64 = SystemTime::now()
.duration_since(UNIX_EPOCH)
.expect("SystemTime before UNIX EPOCH!")
.as_secs()
.try_into()
.unwrap();
// let current_time: i64 = SystemTime::now()
// .duration_since(UNIX_EPOCH)
// .expect("SystemTime before UNIX EPOCH!")
// .as_secs()
// .try_into()
// .unwrap();
current_time <= (item.cached + (2*60)) && item.content != ""
// current_time <= (item.cached + (2*60)) && item.content != ""
true
}
lazy_static! {