mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 00:23:17 +00:00
24 lines
509 B
Python
24 lines
509 B
Python
from celery import Celery
|
|
from application.core.settings import settings
|
|
from celery.signals import setup_logging
|
|
|
|
|
|
def make_celery(app_name=__name__):
|
|
celery = Celery(
|
|
app_name,
|
|
broker=settings.CELERY_BROKER_URL,
|
|
backend=settings.CELERY_RESULT_BACKEND,
|
|
)
|
|
celery.conf.update(settings)
|
|
return celery
|
|
|
|
|
|
@setup_logging.connect
|
|
def config_loggers(*args, **kwargs):
|
|
from application.core.logging_config import setup_logging
|
|
|
|
setup_logging()
|
|
|
|
|
|
celery = make_celery()
|