"""
Pusher WebSocket configuration for real-time progress updates
"""
import pusher
from src.core.config import settings

def get_pusher_client():
    """
    Returns configured Pusher client instance for sending real-time updates.
    
    Make sure to add these to your .env file:
    PUSHER_APP_ID=your_app_id
    PUSHER_KEY=your_key
    PUSHER_SECRET=your_secret
    PUSHER_CLUSTER=your_cluster (e.g., 'us2', 'eu', 'ap1')
    """
    try:
        pusher_client = pusher.Pusher(
            app_id=settings.PUSHER_APP_ID,
            key=settings.PUSHER_KEY,
            secret=settings.PUSHER_SECRET,
            cluster=settings.PUSHER_CLUSTER,
            ssl=True
        )
        return pusher_client
    except Exception as e:
        print(f"[Pusher Config Error] {str(e)}")
        return None

# Singleton instance
pusher_client = get_pusher_client()
