From 12ef824c9149bc28a8827e158f42fa440f6e2fff Mon Sep 17 00:00:00 2001 From: Joshua Gottlieb Date: Sat, 12 Oct 2024 06:44:51 -0500 Subject: [PATCH] changing botStartTime global at restart. Apparently globals aren't reset in docker after restart --- Constants.py | 2 +- StaticMethods.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Constants.py b/Constants.py index 1c41851..f7091e8 100644 --- a/Constants.py +++ b/Constants.py @@ -52,7 +52,7 @@ class Constants: WAIT_BETWEEN_MESSAGES = 1800 # minimum amount of time in seconds the stream has to be offline before new notification messages. MIN_TIME_BEFORE_AVATAR_CHANGE = 48 # Minimum time before avatar changes -- in hours ONLINE_MESSAGE_REBROADCAST_TIME = 86400 #Time in seconds the stream will be online before another online notification will be broadcasted - TIME_BEFORE_BOT_RESTART = 21600 #time in seconds before bot will restart. Restart checks are made every 10 minutes + TIME_BEFORE_BOT_RESTART = 86400 #time in seconds before bot will restart. Restart checks are made every 10 minutes TIME_OFFLINE_BEFORE_RESTART = 900 #minimum time in seconds stream needs to be offline before bot will restart IF TIME_BEFORE_BOT_RESTART time has been met TEMP_TITLE_UPTIME = 57600 #Time in seconds temp titles will be used before default titles are used TIME_BEFORE_REVIEW_RESET = 300 # Time a whitelisted person has to review a confession before its added back to the queue diff --git a/StaticMethods.py b/StaticMethods.py index 2d1d75c..5520edb 100644 --- a/StaticMethods.py +++ b/StaticMethods.py @@ -259,6 +259,7 @@ def timeToSeconds(newTime: float) -> int: def rebootServer() -> None: logger.critical("Sassbot server rebooting from restart command or fd leak detection or scheduled restart based off TIME_BEFORE_BOT_RESTART") + globals.botStartTime = time.time() os.system('reboot') def safeRebootServer() -> None: