Spaces:
Sleeping
Sleeping
| import os | |
| from celery import Celery | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| redis_url = os.getenv("REDIS_URL") | |
| celery_app = Celery( | |
| "interview_simulation_api", | |
| broker=redis_url, | |
| backend=redis_url, | |
| include=['src.tasks'] | |
| ) | |
| celery_app.conf.update( | |
| task_serializer="json", | |
| accept_content=["json"], | |
| result_serializer="json", | |
| timezone="Europe/Paris", | |
| enable_utc=True, | |
| task_track_started=True, | |
| broker_connection_retry_on_startup=True, | |
| broker_transport_options={ | |
| "visibility_timeout": 3600, | |
| "socket_timeout": 30, # Increase socket timeout | |
| "socket_connect_timeout": 30 | |
| } | |
| ) | |