From a63c2dcf003d0b60dd326fc0c991662f4b590f3f Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sat, 2 Sep 2023 22:19:17 +0200 Subject: [PATCH] Removing saving data realtime => from 5s to 30s --- app/classes/shared/server.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 45675de5..17773833 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -253,6 +253,23 @@ class ServerInstance: seconds=5, id="stats_" + str(self.server_id), ) + logger.info(f"Saving server statistics {self.name} every {30} seconds") + Console.info(f"Saving server statistics {self.name} every {30} seconds") + try: + self.server_scheduler.add_job( + self.record_server_stats, + "interval", + seconds=30, + id="save_stats_" + str(self.server_id), + ) + except: + self.server_scheduler.remove_job("save_" + str(self.server_id)) + self.server_scheduler.add_job( + self.record_server_stats, + "interval", + seconds=30, + id="save_" + str(self.server_id), + ) def setup_server_run_command(self): # configure the server @@ -1526,7 +1543,7 @@ class ServerInstance: total_players += int(raw_ping_result.get("online")) max_players += int(raw_ping_result.get("max")) - self.record_server_stats() + # self.record_server_stats() if (len(servers_ping) > 0) & (len(WebSocketManager().auth_clients) > 0): try: