From 2b12269917dbaf9d4eefd2f382a4a256b8427162 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 29 Aug 2024 11:50:42 +0000 Subject: [PATCH] fix: increased delay to 2500, renamed method --- .../Administration/DangerousCommands/CleanupCommands.cs | 6 +++--- .../Administration/DangerousCommands/CleanupService.cs | 2 +- .../DangerousCommands/_common/ICleanupService.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupCommands.cs b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupCommands.cs index 4580763ce..b32ef47ec 100644 --- a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupCommands.cs +++ b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupCommands.cs @@ -62,10 +62,10 @@ public partial class Administration if (!response) return; - for (var i = startShardId; i < _creds.GetCreds().TotalShards; i++) + for (var shardId = startShardId; shardId < _creds.GetCreds().TotalShards; shardId++) { - await _svc.LeaveUnkeptServers(i); - await Task.Delay(2250 * 1000); + await _svc.StartLeavingUnkeptServers(shardId); + await Task.Delay(2500 * 1000); } await ctx.OkAsync(); diff --git a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs index 4b537712a..6652bcf84 100644 --- a/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/NadekoBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -237,7 +237,7 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, INService return await table.CountAsync(); } - public async Task LeaveUnkeptServers(int shardId) + public async Task StartLeavingUnkeptServers(int shardId) => await _pubSub.Pub(_keepTriggerKey, shardId); private ValueTask OnKeepReport(KeepReport report) diff --git a/src/NadekoBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs b/src/NadekoBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs index 43dd70c59..d41efbb82 100644 --- a/src/NadekoBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs +++ b/src/NadekoBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs @@ -5,5 +5,5 @@ public interface ICleanupService Task DeleteMissingGuildDataAsync(); Task KeepGuild(ulong guildId); Task GetKeptGuildCount(); - Task LeaveUnkeptServers(int shardId); + Task StartLeavingUnkeptServers(int shardId); } \ No newline at end of file