From 15620da10348f71bcb71f612711cb0a0ca45b6c7 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Wed, 1 Jan 2025 22:24:27 +0100 Subject: [PATCH] feat: add small help to see how much time is left in cache Signed-off-by: kjuulh --- crates/gitnow/src/cache.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/gitnow/src/cache.rs b/crates/gitnow/src/cache.rs index d8e1b88..2095a8d 100644 --- a/crates/gitnow/src/cache.rs +++ b/crates/gitnow/src/cache.rs @@ -79,6 +79,11 @@ impl Cache { tracing::debug!("cache has expired"); return Ok(None); } + + tracing::debug!( + "cache is valid for: {} mins", + cache_duration.saturating_sub(file_modified_last).as_secs() / 60 + ); } }