Merge branch 'bug/kill-server' into 'dev'

Fix server not being cleaned up when killed.

See merge request crafty-controller/crafty-commander!215
This commit is contained in:
Andrew 2022-03-19 01:55:22 +00:00
commit 778effab98

View File

@ -336,6 +336,9 @@ class AjaxHandler(BaseHandler):
svr = self.controller.get_server_obj(server_id) svr = self.controller.get_server_obj(server_id)
try: try:
svr.kill() svr.kill()
time.sleep(5)
svr.cleanup_server_object()
svr.record_server_stats()
except Exception as e: except Exception as e:
logger.error(f"Could not find PID for requested termsig. Full error: {e}") logger.error(f"Could not find PID for requested termsig. Full error: {e}")
return return