Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

fix: adjust maximum cache size and improve eviction logging; include remaining bytes in log messages

Tonho9e2caaf35e0a
diff --git a/src-tauri/src/platforms/telegram/thumbnail_cache.rs b/src-tauri/src/platforms/telegram/thumbnail_cache.rs
index fd1e3e60..387c85f6 100644
--- a/src-tauri/src/platforms/telegram/thumbnail_cache.rs
+++ b/src-tauri/src/platforms/telegram/thumbnail_cache.rs
@@ -10,7 +10,7 @@ use super::auth::TelegramSessionHandle;
use super::parallel_download::fetch_raw_media;
const TTL_SECS: u64 = 120;
-const MAX_BYTES: u64 = 50 * 1024 * 1024;
+const MAX_BYTES: u64 = 30 * 1024 * 1024;
struct CacheEntry {
data: Vec<u8>,
@@ -81,10 +81,11 @@ impl ThumbnailCache {
}
}
- tracing::debug!(
- "[tg-cache] evicted {} expired entries, freed {} bytes",
+ tracing::info!(
+ "[tg-cache] evicted {} expired entries, freed {} bytes, remaining {} bytes",
count,
- freed
+ freed,
+ self.total_bytes
);
}
@@ -110,10 +111,11 @@ impl ThumbnailCache {
}
}
- tracing::debug!(
- "[tg-cache] evicted {} entries for capacity, freed {} bytes",
+ tracing::info!(
+ "[tg-cache] evicted {} entries for capacity, freed {} bytes, remaining {} bytes",
count,
- freed
+ freed,
+ self.total_bytes
);
}
}