mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fixed bug where start command checks if the server was updating would fail everytime.
This commit is contained in:
parent
979c67d064
commit
902f7e79bb
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user