From d186cf048f10dedd739b95ba5d901c6b08161eb8 Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Thu, 5 Mar 2020 15:59:49 +0100 Subject: [PATCH] add more detailed logs --- src/cache.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cache.rs b/src/cache.rs index 379077b..21f3b4a 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -57,9 +57,11 @@ impl File { .metadata() .map(|meta| meta.modified().unwrap_or(SystemTime::UNIX_EPOCH)) .unwrap_or(SystemTime::UNIX_EPOCH); + let age = modified.elapsed().unwrap_or(Duration::from_secs(u64::max_value())); + debug!("Age of cache file: {} s", age.as_secs()); - if modified.elapsed().unwrap_or(Duration::from_secs(u64::max_value())) > self.ttl { - debug!("Cache file is too older (> days), won't be used"); + if age > self.ttl { + debug!("Cache file is too old (> {} seconds), won't be used", self.ttl.as_secs()); return false; }