Skip to content

Commit

Permalink
Fix last_used in tmp cache not updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc authored Sep 21, 2024
1 parent 50fb55f commit a83465f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tmp_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down

0 comments on commit a83465f

Please sign in to comment.