From cbdf76d9945535d77ff85496d4c78bd5400b1c10 Mon Sep 17 00:00:00 2001 From: Marlon Baeten Date: Fri, 23 Feb 2024 12:34:57 +0100 Subject: [PATCH] Log when deleting messages after X time --- backend/src/storage.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/storage.rs b/backend/src/storage.rs index 9022ea8..e48b050 100644 --- a/backend/src/storage.rs +++ b/backend/src/storage.rs @@ -42,7 +42,16 @@ pub(crate) async fn storage( .duration_since(SystemTime::UNIX_EPOCH)? .as_secs() as i64; - storage.retain(|_, mail_message| mail_message.time > remove_before); + storage.retain(|_, mail_message| { + if mail_message.time > remove_before { + true + } else { + info!("Removing old message {} from {}", mail_message.id, mail_message.envelope_from); + + false + } + + }); } } },