"""
Celery Configuration for SYNC Backend.

This file configures Celery for handling background tasks like:
- Fetching Instagram data
- Calculating metrics
- Running AI model predictions
"""

import os
from celery import Celery

# Set the default Django settings module
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sync_backend.settings')

# Create Celery app
app = Celery('sync_backend')

# Load config from Django settings with CELERY namespace
app.config_from_object('django.conf:settings', namespace='CELERY')

# Auto-discover tasks from all installed apps
app.autodiscover_tasks()


@app.task(bind=True, ignore_result=True)
def debug_task(self):
    """Debug task to test Celery is working"""
    print(f'Request: {self.request!r}')







