Caching update

- New invalidator: bomb dropped
- Reduce cache lifetime to 10 seconds (down from 3 minutes)
This commit is contained in:
Janek
2024-01-02 01:08:25 +01:00
parent dc7ff86c38
commit fbdec0f946
2 changed files with 11 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ pub struct Cache {
impl Cache {
pub fn is_valid(&self) -> bool {
if self.valid {
if self.timestamp.elapsed() > std::time::Duration::from_secs(60 * 3) {
if self.timestamp.elapsed() > std::time::Duration::from_secs(10) {
log::info!("Invalidated cache! Reason: time");
return false
}