diff --git a/RegexBot/Module/ModLogs/MessageCache.cs b/RegexBot/Module/ModLogs/MessageCache.cs index 00bb39f..da0b05e 100644 --- a/RegexBot/Module/ModLogs/MessageCache.cs +++ b/RegexBot/Module/ModLogs/MessageCache.cs @@ -278,6 +278,14 @@ namespace Noikoio.RegexBot.Module.ModLogs + ")"; c.ExecuteNonQuery(); } + + // For lack of an automated mechanism, delete old messages on startup here. + using (var c = db.CreateCommand()) + { + c.CommandText = "DELETE FROM " + TableMessage + " WHERE " + + "coalesce(edited_ts, created_ts) < (now() - interval '90 days')"; + c.ExecuteNonQuery(); + } } }