Cleanup server schedule on delete

This commit is contained in:
Andrew 2022-05-15 14:00:24 -05:00
parent e161e2cf0b
commit 490fc86d4e
2 changed files with 2 additions and 4 deletions

View File

@ -812,6 +812,7 @@ class Controller:
Console.info(f"Deleting Server: ID {server_id} | Name: {server_name} ") Console.info(f"Deleting Server: ID {server_id} | Name: {server_name} ")
srv_obj = server["server_obj"] srv_obj = server["server_obj"]
srv_obj.server_scheduler.shutdown()
running = srv_obj.check_running() running = srv_obj.check_running()
if running: if running:
@ -841,7 +842,6 @@ class Controller:
# Cleanup scheduled tasks # Cleanup scheduled tasks
try: try:
srv_obj.remove_stats_job()
HelpersManagement.delete_scheduled_task_by_server(server_id) HelpersManagement.delete_scheduled_task_by_server(server_id)
except DoesNotExist: except DoesNotExist:
logger.info("No scheduled jobs exist. Continuing.") logger.info("No scheduled jobs exist. Continuing.")

View File

@ -1,3 +1,4 @@
from logging import exception
import os import os
import re import re
import time import time
@ -504,9 +505,6 @@ class Server:
f"Assuming it was never started." f"Assuming it was never started."
) )
def remove_stats_job(self):
self.server_scheduler.remove_job("stats_" + str(self.server_id))
def start_crash_detection(self): def start_crash_detection(self):
# This is only used if the crash detection settings change # This is only used if the crash detection settings change
# while the server is running. # while the server is running.