From c924663ab3964e772f6114f42753c3f3b02e150a Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 10 Jun 2022 19:04:34 -0400 Subject: [PATCH] Fix stack on server stop --- app/classes/shared/server.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index 7ff2f243..24daaceb 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -593,9 +593,14 @@ class ServerInstance: self.cleanup_server_object() server_users = PermissionsServers.get_server_user_list(self.server_id) - # remove the stats polling job since server is stopped - self.server_scheduler.remove_job("stats_" + str(self.server_id)) - + try: + # remove the stats polling job since server is stopped + 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.record_server_stats() for user in server_users: