added some logging to .leaveunkeptservers

This commit is contained in:
Toastie 2024-08-28 20:00:58 +12:00
parent 1c53371598
commit 74767e8661
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -58,7 +58,7 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService
keepTriggered = true;
try
{
var allGuildIds = _client.Guilds.Select(x => x.Id);
var allGuildIds = _client.Guilds.Select(x => x.Id).ToArray();
HashSet<ulong> dontDelete;
await using (var db = _db.GetDbContext())
@ -74,7 +74,7 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService
dontDelete = dontDeleteList.ToHashSet();
}
guildIds = new();
Log.Information("Leaving {RemainingCount} guilds every {Delay} seconds, {DontDeleteCount} will remain", allGuildIds.Length - dontDelete.Count, delay, dontDelete.Count);
foreach (var guildId in allGuildIds)
{
if (dontDelete.Contains(guildId))