mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Cleanup server schedule on delete
This commit is contained in:
parent
e161e2cf0b
commit
490fc86d4e
@ -812,6 +812,7 @@ class Controller:
|
||||
Console.info(f"Deleting Server: ID {server_id} | Name: {server_name} ")
|
||||
|
||||
srv_obj = server["server_obj"]
|
||||
srv_obj.server_scheduler.shutdown()
|
||||
running = srv_obj.check_running()
|
||||
|
||||
if running:
|
||||
@ -841,7 +842,6 @@ class Controller:
|
||||
|
||||
# Cleanup scheduled tasks
|
||||
try:
|
||||
srv_obj.remove_stats_job()
|
||||
HelpersManagement.delete_scheduled_task_by_server(server_id)
|
||||
except DoesNotExist:
|
||||
logger.info("No scheduled jobs exist. Continuing.")
|
||||
|
@ -1,3 +1,4 @@
|
||||
from logging import exception
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
@ -504,9 +505,6 @@ class Server:
|
||||
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):
|
||||
# This is only used if the crash detection settings change
|
||||
# while the server is running.
|
||||
|
Loading…
Reference in New Issue
Block a user