From 46ca7eeef08f71ed4335ee598826ab3841151f02 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Thu, 23 Feb 2023 11:57:22 -0500 Subject: [PATCH] Fix launch check bug. Automated server starts were not caught --- app/classes/shared/server.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 65b16386..1fd1ffbc 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -211,19 +211,6 @@ class ServerInstance: def run_threaded_server(self, user_id, forge_install=False): # start the server - if self.helper.dir_migration: - self.helper.websocket_helper.broadcast_user( - user_id, - "send_start_error", - { - "error": self.helper.translation.translate( - "error", - "migration", - HelperUsers.get_user_lang_by_id(user_id), - ) - }, - ) - return False self.server_thread = threading.Thread( target=self.start_server, daemon=True, @@ -321,6 +308,22 @@ class ServerInstance: else: user_lang = HelperUsers.get_user_lang_by_id(user_id) + # Checks if user is currently attempting to move global server + # dir + if self.helper.dir_migration: + self.helper.websocket_helper.broadcast_user( + user_id, + "send_start_error", + { + "error": self.helper.translation.translate( + "error", + "migration", + user_lang, + ) + }, + ) + return False + if self.stats_helper.get_import_status() and not forge_install: if user_id: self.helper.websocket_helper.broadcast_user(