Fix last_used in tmp cache not updated

This commit is contained in:
2024-09-21 01:32:48 +00:00
committed by GitHub
parent 50fb55f053
commit a83465f598

View File

@@ -43,6 +43,12 @@ impl TmpCache {
match self.db.get_tmp_cache(url).await? {
Some(ent) => {
if tokio::fs::try_exists(&ent.path).await.unwrap_or(false) {
match self.db.update_tmp_cache(url).await {
Ok(_) => {}
Err(e) => {
log::warn!(target: "tmp_cache", "Failed to update tmp cache entry {} in database: {}", url, e);
}
}
return Ok(PathBuf::from(&ent.path));
}
}