a2ba3d8d2b
- bcrypt 5.x breaks passlib 1.7.4, pin to 4.0.1 - autodiscover_tasks not finding task modules, add explicit imports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
757 B
Python
32 lines
757 B
Python
from celery import Celery
|
|
from celery.schedules import crontab
|
|
|
|
from app.config import settings
|
|
|
|
celery_app = Celery(
|
|
"meeting_protocol",
|
|
broker=settings.redis_url,
|
|
backend=settings.redis_url,
|
|
)
|
|
|
|
celery_app.conf.update(
|
|
task_serializer="json",
|
|
accept_content=["json"],
|
|
result_serializer="json",
|
|
timezone="UTC",
|
|
enable_utc=True,
|
|
task_track_started=True,
|
|
beat_schedule={
|
|
"cleanup-old-data": {
|
|
"task": "app.tasks.cleanup.cleanup_old_data",
|
|
"schedule": crontab(hour=3, minute=0),
|
|
},
|
|
},
|
|
)
|
|
|
|
celery_app.autodiscover_tasks(["app.tasks"])
|
|
|
|
import app.tasks.transcription # noqa: F401, E402
|
|
import app.tasks.protocol # noqa: F401, E402
|
|
import app.tasks.cleanup # noqa: F401, E402
|