mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 05:54:36 +00:00
Only remove data from guilds in own shard
This commit is contained in:
parent
59696ee000
commit
41def830c4
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue