From d4576dfc283c5597d80def2d29b6932a21b7e7ac Mon Sep 17 00:00:00 2001 From: GardenHumster Date: Wed, 27 Dec 2023 15:59:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E6=AD=BB=E5=BE=AA=E7=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Theresa3rd-Bot/TheresaBot.Main/Timers/SchedulerManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Theresa3rd-Bot/TheresaBot.Main/Timers/SchedulerManager.cs b/Theresa3rd-Bot/TheresaBot.Main/Timers/SchedulerManager.cs index 25e46e87..46acd963 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Timers/SchedulerManager.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Timers/SchedulerManager.cs @@ -336,9 +336,8 @@ private static async Task DestroyAsync(this IScheduler scheduler) try { if (scheduler is null) return; - if (scheduler.IsShutdown) return; await scheduler.Shutdown(false); - await scheduler.DestroyAsync(); + await scheduler.Clear(); } catch (Exception ex) { From a632b3b56ecc30097987cd0fc0664a5c8f0c71e3 Mon Sep 17 00:00:00 2001 From: GardenHumster Date: Wed, 27 Dec 2023 16:05:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=8C=85=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Handler/PixivRankingHandler.cs | 2 +- .../TheresaBot.Main/TheresaBot.Main.csproj | 12 ++++++------ .../TheresaBot.Main/Timers/TimingRankingJob.cs | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivRankingHandler.cs b/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivRankingHandler.cs index 12f25c18..0e5d6576 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivRankingHandler.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Handler/PixivRankingHandler.cs @@ -89,7 +89,7 @@ public async Task SendWeeklyR18Ranking(GroupCommand command) await ReplyRanking(command, rankingMode, rankingItem); } - public async Task HandleRankingSubscribeAsync(PixivRankingTimer rankingTimer, PixivRankingItem rankingItem, PixivRankingMode rankingMode) + public async Task PushRankingAsync(PixivRankingTimer rankingTimer, PixivRankingItem rankingItem, PixivRankingMode rankingMode) { try { diff --git a/Theresa3rd-Bot/TheresaBot.Main/TheresaBot.Main.csproj b/Theresa3rd-Bot/TheresaBot.Main/TheresaBot.Main.csproj index ab26f65c..06debe29 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/TheresaBot.Main.csproj +++ b/Theresa3rd-Bot/TheresaBot.Main/TheresaBot.Main.csproj @@ -16,21 +16,21 @@ - + - - + + - + - + - + diff --git a/Theresa3rd-Bot/TheresaBot.Main/Timers/TimingRankingJob.cs b/Theresa3rd-Bot/TheresaBot.Main/Timers/TimingRankingJob.cs index b99b7665..ef3dfa2b 100644 --- a/Theresa3rd-Bot/TheresaBot.Main/Timers/TimingRankingJob.cs +++ b/Theresa3rd-Bot/TheresaBot.Main/Timers/TimingRankingJob.cs @@ -43,47 +43,47 @@ private async Task HandleTiming(BaseSession session, BaseReporter reporter, Pixi var rankingHandler = new PixivRankingHandler(session, reporter); if (rankingName == "daily") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Daily, PixivRankingMode.Daily); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Daily, PixivRankingMode.Daily); return; } if (rankingName == "dailyai") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.DailyAI, PixivRankingMode.DailyAI); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.DailyAI, PixivRankingMode.DailyAI); return; } if (rankingName == "male") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Male, PixivRankingMode.Male); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Male, PixivRankingMode.Male); return; } if (rankingName == "weekly") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Weekly, PixivRankingMode.Weekly); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Weekly, PixivRankingMode.Weekly); return; } if (rankingName == "monthly") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Monthly, PixivRankingMode.Monthly); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Monthly, PixivRankingMode.Monthly); return; } if (rankingName == "dailyr18") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Daily, PixivRankingMode.Daily_R18); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Daily, PixivRankingMode.Daily_R18); return; } if (rankingName == "dailyair18") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.DailyAI, PixivRankingMode.DailyAI_R18); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.DailyAI, PixivRankingMode.DailyAI_R18); return; } if (rankingName == "maler18") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Male, PixivRankingMode.Male_R18); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Male, PixivRankingMode.Male_R18); return; } if (rankingName == "weeklyr18") { - await rankingHandler.HandleRankingSubscribeAsync(rankingTimer, BotConfig.PixivRankingConfig.Weekly, PixivRankingMode.Weekly_R18); + await rankingHandler.PushRankingAsync(rankingTimer, BotConfig.PixivRankingConfig.Weekly, PixivRankingMode.Weekly_R18); return; } }