From a83465f5983ce7c434cdb1fc10998f0b129b4b74 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sat, 21 Sep 2024 01:32:48 +0000 Subject: [PATCH] Fix last_used in tmp cache not updated --- src/tmp_cache/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tmp_cache/mod.rs b/src/tmp_cache/mod.rs index 9b6affa..4e37f52 100644 --- a/src/tmp_cache/mod.rs +++ b/src/tmp_cache/mod.rs @@ -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)); } }