From 17d2e0415a5f0c346bade3136e30a71fa3f2066d Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sun, 31 May 2026 10:00:34 -0500 Subject: [PATCH] Reconnection attempts reset the inactivity timer so don't solely consider it for deciding whether to restart --- KfChatDotNetBot/ChatBot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KfChatDotNetBot/ChatBot.cs b/KfChatDotNetBot/ChatBot.cs index 7a02640..442086e 100644 --- a/KfChatDotNetBot/ChatBot.cs +++ b/KfChatDotNetBot/ChatBot.cs @@ -178,7 +178,7 @@ public class ChatBot var deadTime = DateTime.UtcNow - _lastReconnectAttempt; // No connection and no successful reconnection attempt in the last 5 minutes // Either the site is completely dead or the bot got screwed by a nasty error and can't reconnect - if (inactivityTime > TimeSpan.FromMinutes(10) && deadTime > TimeSpan.FromMinutes(15)) + if (inactivityTime > TimeSpan.FromMinutes(10) || deadTime > TimeSpan.FromMinutes(15)) { var shouldExit = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.BotExitOnDeath)).ToBoolean(); _logger.Error("The bot as is dead beyond belief right now");