mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 13:18:12 +08:00
replace rollbar reporting with generic error_reporter reporting in cluster.py
This commit is contained in:
+5
-5
@@ -30,7 +30,7 @@ from django import db
|
|||||||
import signing
|
import signing
|
||||||
import tasks
|
import tasks
|
||||||
|
|
||||||
from django_q.conf import Conf, logger, psutil, get_ppid, rollbar
|
from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter
|
||||||
from django_q.models import Task, Success, Schedule
|
from django_q.models import Task, Success, Schedule
|
||||||
from django_q.status import Stat, Status
|
from django_q.status import Stat, Status
|
||||||
from django_q.brokers import get_broker
|
from django_q.brokers import get_broker
|
||||||
@@ -368,8 +368,8 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
|||||||
f = getattr(m, func)
|
f = getattr(m, func)
|
||||||
except (ValueError, ImportError, AttributeError) as e:
|
except (ValueError, ImportError, AttributeError) as e:
|
||||||
result = (e, False)
|
result = (e, False)
|
||||||
if rollbar:
|
if error_reporter:
|
||||||
rollbar.report_exc_info()
|
error_reporter.report()
|
||||||
# We're still going
|
# We're still going
|
||||||
if not result:
|
if not result:
|
||||||
db.close_old_connections()
|
db.close_old_connections()
|
||||||
@@ -380,8 +380,8 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
|||||||
result = (res, True)
|
result = (res, True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
result = ('{}'.format(e), False)
|
result = ('{}'.format(e), False)
|
||||||
if rollbar:
|
if error_reporter:
|
||||||
rollbar.report_exc_info()
|
error_reporter.report()
|
||||||
# Process result
|
# Process result
|
||||||
task['result'] = result[0]
|
task['result'] = result[0]
|
||||||
task['success'] = result[1]
|
task['success'] = result[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user