mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 09:08:13 +08:00
putting back support for backwards compatibility
This commit is contained in:
+5
-1
@@ -25,7 +25,7 @@ import signing
|
||||
import tasks
|
||||
|
||||
from django_q.compat import range
|
||||
from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter
|
||||
from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter, rollbar
|
||||
from django_q.models import Task, Success, Schedule
|
||||
from django_q.status import Stat, Status
|
||||
from django_q.brokers import get_broker
|
||||
@@ -367,6 +367,8 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
||||
result = (e, False)
|
||||
if error_reporter:
|
||||
error_reporter.report()
|
||||
if rollbar:
|
||||
rollbar.report_exc_info()
|
||||
# We're still going
|
||||
if not result:
|
||||
db.close_old_connections()
|
||||
@@ -382,6 +384,8 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
||||
result = ('{}'.format(e), False)
|
||||
if error_reporter:
|
||||
error_reporter.report()
|
||||
if rollbar:
|
||||
rollbar.report_exc_info()
|
||||
# Process result
|
||||
task['result'] = result[0]
|
||||
task['success'] = result[1]
|
||||
|
||||
Reference in New Issue
Block a user