Skip to content

Commit

Permalink
Log when deleting messages after X time
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonbaeten committed Feb 23, 2024
1 parent ab3fe05 commit cbdf76d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion backend/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

});
}
}
},
Expand Down

0 comments on commit cbdf76d

Please sign in to comment.