# backend/celery_app.py
from celery import Celery
from utils.config_helper import get_redis_url

# Single shared Celery instance for the entire application
celery = Celery('agentic_tasks', broker=get_redis_url())

# Auto-discover tasks in all task modules
celery.autodiscover_tasks([
    'tasks',
    'tasks.system_health_monitor',  # ← Add this explicitly
])

# Or, alternatively, import the module directly
import tasks.system_health_monitor  # ← Add this
