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