mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 08:28:12 +08:00
Removes old rollbar support - relies on the pluggable error reporters now
This commit is contained in:
+1
-5
@@ -23,7 +23,7 @@ from multiprocessing import Event, Process, Value, current_process
|
||||
# Local
|
||||
from django_q import tasks
|
||||
from django_q.brokers import get_broker
|
||||
from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter, rollbar
|
||||
from django_q.conf import Conf, logger, psutil, get_ppid, error_reporter
|
||||
from django_q.models import Task, Success, Schedule
|
||||
from django_q.queues import Queue
|
||||
from django_q.signals import pre_execute
|
||||
@@ -365,8 +365,6 @@ 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,8 +380,6 @@ def worker(task_queue, result_queue, timer, timeout=Conf.TIMEOUT):
|
||||
result = ('{} : {}'.format(e, traceback.format_exc()), False)
|
||||
if error_reporter:
|
||||
error_reporter.report()
|
||||
if rollbar:
|
||||
rollbar.report_exc_info()
|
||||
# Process result
|
||||
task['result'] = result[0]
|
||||
task['success'] = result[1]
|
||||
|
||||
@@ -150,9 +150,6 @@ class Conf(object):
|
||||
# The redis stats key
|
||||
Q_STAT = 'django_q:{}:cluster'.format(PREFIX)
|
||||
|
||||
# Optional rollbar key
|
||||
ROLLBAR = conf.get('rollbar', {})
|
||||
|
||||
# Optional error reporting setup
|
||||
ERROR_REPORTER = conf.get('error_reporter', {})
|
||||
|
||||
@@ -190,19 +187,6 @@ if not logger.handlers:
|
||||
logger.addHandler(handler)
|
||||
|
||||
|
||||
# rollbar
|
||||
if Conf.ROLLBAR:
|
||||
rollbar_conf = deepcopy(Conf.ROLLBAR)
|
||||
try:
|
||||
import rollbar
|
||||
rollbar.init(rollbar_conf.pop('access_token'), environment=rollbar_conf.pop('environment'), **rollbar_conf)
|
||||
except ImportError:
|
||||
rollbar = None
|
||||
|
||||
else:
|
||||
rollbar = None
|
||||
|
||||
|
||||
# Error Reporting Interface
|
||||
class ErrorReporter(object):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user