first commit - MVE Incrementables Parser microservice with FastAPI, JWT, Celery, Redis
This commit is contained in:
25
app/core/celery_app.py
Normal file
25
app/core/celery_app.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Celery application configuration."""
|
||||
from celery import Celery
|
||||
from .config import get_settings
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
celery_app = Celery(
|
||||
"mve_incrementables_parser",
|
||||
broker=settings.celery_broker_url,
|
||||
backend=settings.celery_result_backend,
|
||||
include=["app.tasks.parse_tasks"]
|
||||
)
|
||||
|
||||
# Celery configuration
|
||||
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, # 5 minutes max
|
||||
task_soft_time_limit=240, # 4 minutes soft limit
|
||||
result_expires=3600, # Results expire after 1 hour
|
||||
)
|
||||
Reference in New Issue
Block a user