diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-03-23 14:49:23 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-03-23 14:49:23 -0400 |
| commit | 7954fbf8113e4a5ced8b61b49fbf51d353034cba (patch) | |
| tree | 5001f019441d18c814231f369d882be585223926 /src | |
| parent | 876472299d67f8fe3a789b7777b9d8ee44297b23 (diff) | |
Expire messages after 30 days.
In a discussion with wlonk, we both agreed that 15 days is _too_ aggressive, but also that it's not quite time to implement configurable expiry.
Diffstat (limited to 'src')
| -rw-r--r-- | src/message/app.rs | 4 | ||||
| -rw-r--r-- | src/test/fixtures/mod.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/message/app.rs b/src/message/app.rs index 60206f1..6f8f3d4 100644 --- a/src/message/app.rs +++ b/src/message/app.rs @@ -80,8 +80,8 @@ impl<'a> Messages<'a> { } pub async fn expire(&self, relative_to: &DateTime) -> Result<(), sqlx::Error> { - // Somewhat arbitrarily, expire after 15 days. - let expire_at = relative_to.to_owned() - TimeDelta::days(15); + // Somewhat arbitrarily, expire after 30 days. + let expire_at = relative_to.to_owned() - TimeDelta::days(30); let mut tx = self.db.begin().await?; diff --git a/src/test/fixtures/mod.rs b/src/test/fixtures/mod.rs index 21e4483..57eee30 100644 --- a/src/test/fixtures/mod.rs +++ b/src/test/fixtures/mod.rs @@ -24,7 +24,7 @@ pub fn now() -> RequestedAt { } pub fn old() -> RequestedAt { - let timestamp = Utc::now() - TimeDelta::days(20); + let timestamp = Utc::now() - TimeDelta::days(40); timestamp.into() } |
