Skip to content

Commit

Permalink
Wire the beat signals with xray (#2259)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimleroyer authored Aug 21, 2024
1 parent 41f7056 commit 36666c8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/celery/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

from flask import current_app

from celery import Celery, Task
from app.aws.xray_celery_handlers import (
xray_after_task_publish,
xray_before_task_publish,
xray_task_failure,
xray_task_postrun,
xray_task_prerun,
)
from celery import Celery, Task, signals
from celery.signals import worker_process_shutdown


Expand Down Expand Up @@ -42,6 +49,14 @@ def init_app(self, app):
task_cls=make_task(app),
)

# Register the xray handlers
signals.after_task_publish.connect(xray_after_task_publish)
signals.before_task_publish.connect(xray_before_task_publish)
signals.task_failure.connect(xray_task_failure)
signals.task_postrun.connect(xray_task_postrun)
signals.task_prerun.connect(xray_task_prerun)
signals.beat_init.connect(xray_task_prerun)

# See https://docs.celeryproject.org/en/stable/userguide/configuration.html
self.conf.update(
{
Expand Down

0 comments on commit 36666c8

Please sign in to comment.