mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 01:35:28 +01:00
Fix bug where stopping a server without crash detection would crash crafty...ironic, I know.
This commit is contained in:
parent
7aebd8bd5b
commit
e69a3be381
@ -322,9 +322,10 @@ class Server:
|
||||
def stop_server(self):
|
||||
if self.settings['stop_command']:
|
||||
self.send_command(self.settings['stop_command'])
|
||||
#remove crash detection watcher
|
||||
logger.info(f"Removing crash watcher for server {self.name}")
|
||||
self.server_scheduler.remove_job('c_' + str(self.server_id))
|
||||
if self.settings['crash_detection']:
|
||||
#remove crash detection watcher
|
||||
logger.info(f"Removing crash watcher for server {self.name}")
|
||||
self.server_scheduler.remove_job('c_' + str(self.server_id))
|
||||
else:
|
||||
#windows will need to be handled separately for Ctrl+C
|
||||
self.process.terminate()
|
||||
@ -408,7 +409,7 @@ class Server:
|
||||
|
||||
print("crash detected")
|
||||
# clear the old scheduled watcher task
|
||||
self.server_scheduler.remove_job("c_"+str(self.server_id))
|
||||
self.server_scheduler.remove_job(f"c_{self.server_id}")
|
||||
|
||||
# the server crashed, or isn't found - so let's reset things.
|
||||
logger.warning(f"The server {name} seems to have vanished unexpectedly, did it crash?")
|
||||
|
Loading…
x
Reference in New Issue
Block a user