mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-06-15 16:55:18 -04:00
Reconnection attempts reset the inactivity timer so don't solely consider it for deciding whether to restart
This commit is contained in:
@@ -178,7 +178,7 @@ public class ChatBot
|
|||||||
var deadTime = DateTime.UtcNow - _lastReconnectAttempt;
|
var deadTime = DateTime.UtcNow - _lastReconnectAttempt;
|
||||||
// No connection and no successful reconnection attempt in the last 5 minutes
|
// 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
|
// 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();
|
var shouldExit = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.BotExitOnDeath)).ToBoolean();
|
||||||
_logger.Error("The bot as is dead beyond belief right now");
|
_logger.Error("The bot as is dead beyond belief right now");
|
||||||
|
|||||||
Reference in New Issue
Block a user