From 41def830c48e0e968c6bad8128a358236ea7c551 Mon Sep 17 00:00:00 2001 From: Noi Date: Fri, 8 Dec 2023 20:44:42 -0800 Subject: [PATCH] Only remove data from guilds in own shard --- BackgroundServices/DataRetention.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BackgroundServices/DataRetention.cs b/BackgroundServices/DataRetention.cs index 1156e48..76b1b83 100644 --- a/BackgroundServices/DataRetention.cs +++ b/BackgroundServices/DataRetention.cs @@ -53,9 +53,11 @@ class DataRetention : BackgroundService { // And let go of old data var staleGuildCount = await db.GuildConfigurations + .Where(g => localGuilds.Contains(g.GuildId)) .Where(g => now - TimeSpan.FromDays(StaleGuildThreshold) > g.LastSeen) .ExecuteDeleteAsync(); var staleUserCount = await db.UserEntries + .Where(gu => localGuilds.Contains(gu.GuildId)) .Where(gu => now - TimeSpan.FromDays(StaleUserThreashold) > gu.LastSeen) .ExecuteDeleteAsync();