Пример #1
0
 def teardown(self):
     """
     Removes current failure handler
     """
     task_prerun.disconnect(self.setup_context)
     task_postrun.disconnect(self.reset_context)
     if self.report_exceptions:
         task_failure.disconnect(self._failure_handler)
     logger.info('Honeybadger Celery support uninstalled')
Пример #2
0
 def disconnect_traced_handlers(self):
     if self._propagate:
         before_task_publish.disconnect(self._prepublish)
         after_task_publish.disconnect(self._postpublish)
     task_prerun.disconnect(self._start_span)
     task_failure.disconnect(self._tag_error)
     task_retry.disconnect(self._tag_retry)
     task_postrun.disconnect(self._finish_span)
     log.debug('Disconnected CeleryTracing signal handlers.')
Пример #3
0
        def stop_worker_soon(**kwargs):
            task_postrun.disconnect(stop_worker_soon)
            if hasattr(worker.consumer, '_pending_operations'):
                # Celery 4.x

                def stop_worker():
                    # avoiding AttributeError that makes tests noisy
                    worker.consumer.connection.drain_events = mock.Mock()

                    worker.stop()

                # worker must be stopped not earlier than
                # data exchange with RabbitMQ is completed
                worker.consumer._pending_operations.insert(0, stop_worker)
            else:
                # Celery 3.x
                worker.stop()
Пример #4
0
 def uninstall(self):
     task_prerun.disconnect(self.handle_task_prerun)
     task_postrun.disconnect(self.handle_task_postrun)
     task_failure.disconnect(self.process_failure_signal)
Пример #5
0
def uninstall():
    before_task_publish.disconnect(before_task_publish_callback)
    task_prerun.disconnect(task_prerun_callback)
    task_postrun.disconnect(task_postrun_callback)
Пример #6
0
def uninstall():
    task_prerun.disconnect(prerun_callback)
    task_postrun.disconnect(postrun_callback)