From c033c0e3c8df881e9e2dd5bd9b35e0a93d0f6297 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Wed, 28 Aug 2024 04:37:03 +0000 Subject: [PATCH] change: added some logging to .leaveunkeptservers --- .../Administration/DangerousCommands/CleanupService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs index e5b075143..41240784c 100644 --- a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -58,7 +58,7 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, INService 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, INService 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))