From 5143dff88804a421cb2dfbd92689ce240bfbb873 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 11 Jul 2021 13:21:57 -0400 Subject: [PATCH] Add logging --- src/cache/disk.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cache/disk.rs b/src/cache/disk.rs index 406b9e9..b085848 100644 --- a/src/cache/disk.rs +++ b/src/cache/disk.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use async_trait::async_trait; use futures::StreamExt; -use log::{error, warn, LevelFilter}; +use log::{debug, error, warn, LevelFilter}; use sqlx::sqlite::SqliteConnectOptions; use sqlx::{ConnectOptions, SqlitePool}; use tokio::fs::remove_file; @@ -175,6 +175,7 @@ async fn db_listener( let mut size_freed = 0; #[allow(clippy::cast_sign_loss)] for item in items { + debug!("deleting file due to exceeding cache size"); size_freed += item.size as u64; tokio::spawn(remove_file(item.id)); }