Browse Source

add more detailed logs

master
Schneider 5 years ago
parent
commit
d186cf048f
  1. 6
      src/cache.rs

6
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;
}

Loading…
Cancel
Save