bookwyrm/celerywyrm/apps.py

14 lines
340 B
Python
Raw Normal View History

from django.apps import AppConfig
from celerywyrm import settings
2022-01-01 22:49:28 +00:00
class CelerywyrmConfig(AppConfig):
2022-01-01 22:49:28 +00:00
name = "celerywyrm"
verbose_name = "BookWyrm Celery"
2022-01-01 22:49:28 +00:00
def ready(self):
if settings.OTEL_EXPORTER_OTLP_ENDPOINT:
from bookwyrm.telemetry import open_telemetry
2022-01-01 22:49:28 +00:00
open_telemetry.instrumentCelery()