Fixed bug where start command checks if the server was updating would fail everytime.

This commit is contained in:
Andrew McManus 2021-07-26 12:11:46 -04:00
parent 979c67d064
commit 902f7e79bb

View File

@ -123,8 +123,8 @@ class Server:
logger.error("Server is already running - Cancelling Startup")
console.error("Server is already running - Cancelling Startup")
return False
if self.settings['updating']:
websocket_helper.broadcast('warn', "Server is updating. Not starting. Please wait for update to finish.")
if self.check_update():
logger.error("Server is updating. Terminating startup.")
return False
logger.info("Launching Server {} with command {}".format(self.name, self.server_command))
@ -387,6 +387,13 @@ class Server:
update_thread = threading.Thread(target=self.a_jar_update, daemon=True, name="exe_update")
update_thread.start()
def check_update(self):
server_stats = db_helper.get_server_stats_by_id(self.server_id)
if server_stats['updating']:
return True
else:
return False
def a_jar_update(self):
wasStarted = "-1"
self.backup_server()