mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix error when stats job does not exist on kill
This commit is contained in:
parent
92eeefb4e8
commit
4a15a2331e
@ -14,6 +14,7 @@ import tempfile
|
||||
# TZLocal is set as a hidden import on win pipeline
|
||||
from tzlocal import get_localzone
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
from apscheduler.jobstores.base import JobLookupError
|
||||
|
||||
from app.classes.minecraft.stats import Stats
|
||||
from app.classes.minecraft.mc_ping import ping, ping_bedrock
|
||||
@ -687,7 +688,11 @@ class ServerInstance:
|
||||
proc.kill()
|
||||
# kill the main process we are after
|
||||
logger.info("Sending SIGKILL to parent")
|
||||
self.server_scheduler.remove_job("stats_" + str(self.server_id))
|
||||
try:
|
||||
self.server_scheduler.remove_job("stats_" + str(self.server_id))
|
||||
except JobLookupError as e:
|
||||
logger.error(f"Could not remove job with id stats_{self.server_id} due"+
|
||||
f" to error: {e}")
|
||||
self.process.kill()
|
||||
|
||||
def get_start_time(self):
|
||||
|
Loading…
Reference in New Issue
Block a user