Commit 509aeaee authored by echel0n's avatar echel0n

Refactored error logging of failed queue tasks to include task name instead of just queue name

Fixed #SICKRAGE-APP-5GP - SchedulerNotRunningError apscheduler.schedulers.base in shutdown, Scheduler is not running
parent b26f805c
......@@ -33,6 +33,7 @@ from collections import deque
from urllib.parse import uses_netloc
from urllib.request import FancyURLopener
from apscheduler.schedulers import SchedulerNotRunningError
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.interval import IntervalTrigger
from dateutil import tz
......@@ -560,7 +561,10 @@ class Core(object):
# shutdown scheduler
if self.scheduler:
self.scheduler.shutdown()
try:
self.scheduler.shutdown()
except SchedulerNotRunningError:
pass
# shutdown webserver
if self.wserver:
......
......@@ -256,8 +256,8 @@ class Queue(object):
if task_id in self.tasks:
sickrage.app.log.debug("Removing {} task {}".format(self.name, task_id))
task = self.tasks.get(task_id)
if task.status == TaskStatus.FAILED:
sickrage.app.log.error("{} task {} failed: {}".format(self.name, task_id, task.error_message))
if task.status == TaskStatus.FAILED and task.error_message:
sickrage.app.log.error("{} task {} failed: {}".format(task.name, task_id, task.error_message))
if task in self.queue:
self.queue.remove(self.tasks.get(task_id))
del self.tasks[task_id]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment