From 1156a82297fa6a9097476296aa0998971dec185a Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 25 Sep 2015 04:09:16 -0700 Subject: [PATCH] Make ErrorReporter run successfully on Zulip voyager. (imported from commit 8ab2fb57fb3e580775cb8959e3b8b5a1277ea9d3) --- zerver/worker/queue_processors.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index d8bfb5a3ab..60d4899f48 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -225,16 +225,19 @@ class FeedbackBot(QueueProcessingWorker): @assign_queue('error_reports') class ErrorReporter(QueueProcessingWorker): def start(self): - self.staging_client = make_feedback_client() - self.staging_client._register( + if settings.DEPLOYMENT_ROLE_KEY: + self.staging_client = make_feedback_client() + self.staging_client._register( 'forward_error', method='POST', url='deployments/report_error', make_request=(lambda type, report: {'type': type, 'report': simplejson.dumps(report)}), - ) + ) QueueProcessingWorker.start(self) def consume(self, event): + if not settings.DEPLOYMENT_ROLE_KEY: + return self.staging_client.forward_error(event['type'], event['report']) @assign_queue('slow_queries')