from celery.schedules import crontab


CELERY_BROKER_URL='redis://localhost:6379/0'
CELERY_RESULT_BACKEND='redis://localhost:6379/1'

CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'UTC'  # or your timezone
CELERY_ENABLE_UTC = True

CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT = 60 * 20
CELERY_TASK_SOFT_TIME_LIMIT = 60 * 15

CELERY_BEAT_SCHEDULE = {
    'cleanup-recordings-every-night': {
        'task': 'apps.calls.tasks.cleanup_old_recordings_tasks',
        'schedule': crontab(hour=2, minute=0),
    },

    # 'process-booking-intents-every-5min': {
    #     'task': 'apps.calls.tasks.process_all_booking_intents_task',
    #     'schedule': crontab('*/10'),
    # }
}
