from celery import Celery from app.config import settings celery_app = Celery( "tradmate", broker=settings.CELERY_BROKER_URL, backend=settings.CELERY_RESULT_BACKEND, include=[ "app.workers.tasks", ], ) celery_app.conf.update( task_serializer="json", accept_content=["json"], result_serializer="json", timezone="UTC", enable_utc=True, task_track_started=True, task_time_limit=300, worker_prefetch_multiplier=4, worker_max_tasks_per_child=1000, beat_schedule={ "check-silent-customers": { "task": "app.workers.tasks.check_silent_customers", "schedule": 3600.0, }, "update-customer-health-cache": { "task": "app.workers.tasks.update_customer_health_cache", "schedule": 3600.0, }, "cleanup-old-sessions": { "task": "app.workers.tasks.cleanup_old_sessions", "schedule": 86400.0, }, "daily-corpus-training": { "task": "app.workers.tasks.run_daily_corpus_training", "schedule": 86400.0, }, "check-followup-engine": { "task": "app.workers.tasks.check_followup_engine", "schedule": 21600.0, }, }, )