Files
platform-project/modules/request-module/request_app/workers/celery_app.py
T
alex 6c86f0f571 TT-003: complete request-module integration into modular platform
- integrated request-module into module registry
- moved backend into modules/request-module
- added manifest.json and module.py
- implemented dynamic router mounting
- implemented dynamic static mounting
- removed direct dependencies from platform core
- verified startup with request-module
- verified startup without request-module
- added implementation_report_003.md
2026-08-06 16:31:27 +03:00

36 lines
954 B
Python

"""Shared Celery application configuration."""
from celery import Celery
from request_app.settings import get_settings
settings = get_settings()
celery_app = Celery(
"service_request_workers",
broker=settings.RABBITMQ_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,
task_time_limit=30 * 60,
task_soft_time_limit=25 * 60,
task_routes={
"app.workers.email_worker.*": {"queue": "email"},
"app.workers.sms_worker.*": {"queue": "sms"},
},
beat_schedule={
"fetch-incoming-emails": {
"task": "app.workers.email_worker.fetch_incoming_emails",
"schedule": 60.0, # check every minute; actual interval controlled by email_fetch_interval setting
},
},
)
celery_app.autodiscover_tasks(["app.workers"])