Disable memory cache expiry
All checks were successful
Fly Deploy / Deploy app (push) Successful in 2m4s
All checks were successful
Fly Deploy / Deploy app (push) Successful in 2m4s
This commit is contained in:
parent
10b6b8051e
commit
429f7def5b
15
src/cache/mod.rs
vendored
15
src/cache/mod.rs
vendored
|
@ -17,14 +17,15 @@ pub struct CachedItem {
|
||||||
|
|
||||||
/// Determine whether we should actually use the cached item or not.
|
/// Determine whether we should actually use the cached item or not.
|
||||||
fn should_use(item: &CachedItem) -> bool {
|
fn should_use(item: &CachedItem) -> bool {
|
||||||
let current_time: i64 = SystemTime::now()
|
// let current_time: i64 = SystemTime::now()
|
||||||
.duration_since(UNIX_EPOCH)
|
// .duration_since(UNIX_EPOCH)
|
||||||
.expect("SystemTime before UNIX EPOCH!")
|
// .expect("SystemTime before UNIX EPOCH!")
|
||||||
.as_secs()
|
// .as_secs()
|
||||||
.try_into()
|
// .try_into()
|
||||||
.unwrap();
|
// .unwrap();
|
||||||
|
|
||||||
current_time <= (item.cached + (2*60)) && item.content != ""
|
// current_time <= (item.cached + (2*60)) && item.content != ""
|
||||||
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
|
Loading…
Reference in a new issue