mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-24 17:34:13 +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
|
// And let go of old data
|
||||||
var staleGuildCount = await db.GuildConfigurations
|
var staleGuildCount = await db.GuildConfigurations
|
||||||
|
.Where(g => localGuilds.Contains(g.GuildId))
|
||||||
.Where(g => now - TimeSpan.FromDays(StaleGuildThreshold) > g.LastSeen)
|
.Where(g => now - TimeSpan.FromDays(StaleGuildThreshold) > g.LastSeen)
|
||||||
.ExecuteDeleteAsync();
|
.ExecuteDeleteAsync();
|
||||||
var staleUserCount = await db.UserEntries
|
var staleUserCount = await db.UserEntries
|
||||||
|
.Where(gu => localGuilds.Contains(gu.GuildId))
|
||||||
.Where(gu => now - TimeSpan.FromDays(StaleUserThreashold) > gu.LastSeen)
|
.Where(gu => now - TimeSpan.FromDays(StaleUserThreashold) > gu.LastSeen)
|
||||||
.ExecuteDeleteAsync();
|
.ExecuteDeleteAsync();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue