def init_app(self, app, sentry):
self.app = app
new_celery = celery.Celery(
app.import_name,
broker=app.config['CELERY_BROKER_URL'],
backend=app.config['CELERY_RESULT_BACKEND'],
)
# XXX(dcramer): why the hell am I wasting time trying to make Celery work?
self.celery.__dict__.update(vars(new_celery))
self.celery.conf.update(app.config)
worker_process_init.connect(self._worker_process_init)
task_postrun.connect(self._task_postrun)
task_prerun.connect(self._task_prerun)
if sentry:
register_signal(sentry.client)
register_logger_signal(sentry.client)
评论列表
文章目录