From 74767e86611479949f4dd8034469992d2de51f56 Mon Sep 17 00:00:00 2001 From: Toastie Date: Wed, 28 Aug 2024 20:00:58 +1200 Subject: [PATCH] added some logging to .leaveunkeptservers --- .../Administration/DangerousCommands/CleanupService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs index 4e01f4b..b36d988 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -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 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))