U
    lh                     @   s   d Z ddlmZmZ ddlZddlmZ ddlmZ ej	
dd edZejd	d
d e  ejjdddgddddddddddddddid ejdddd Zejdd ZdS )a  
Celery configuration for Adtlas DAI Management System.

This module configures Celery for handling background tasks such as:
- VAST call processing
- Ad encoding operations
- Analytics data processing
- Report generation
- File transfers
- Notification sending

Celery is used for:
1. Asynchronous task execution
2. Periodic task scheduling
3. Task result storage
4. Task monitoring and management

For more information on Celery configuration, see:
https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html
    )absolute_importunicode_literalsN)Celery)settingsDJANGO_SETTINGS_MODULEzcore.settingsZadtlaszdjango.conf:settingsZCELERY)	namespaceTjsonzredis://redis:6379/0UTCF   i  i  Zmaster_nameZmymaster)Ztask_track_startedZtask_serializerZaccept_contentZresult_serializerZ"broker_connection_retry_on_startupZresult_backendtimezoneZ
enable_utcZtask_always_eagerZtask_eager_propagatesZtask_ignore_resultZtask_store_eager_resultZworker_prefetch_multiplierZworker_max_tasks_per_childZresult_expiresZ result_backend_transport_options)bindc                 C   s   t d| j d| jj S )a  
    Debug task for testing Celery configuration.
    
    This task can be used to verify that Celery is working correctly.
    It prints the request information and returns a success message.
    
    Returns:
        str: Debug information about the task request
    z	Request: z.Debug task executed successfully. Request ID: )printrequestid)self r   '/var/www/html/Adtlas/src/core/celery.py
debug_taskL   s    r   c                   C   s   ddt   dS )z
    Health check task for monitoring Celery workers.
    
    This task can be used by monitoring systems to verify that
    Celery workers are responsive and functioning correctly.
    
    Returns:
        dict: Health status information
    ZhealthyzAdtlas Celery Worker)statusZservice	timestamp)appnow	isoformatr   r   r   r   health_check[   s    
r   )__doc__
__future__r   r   osceleryr   django.confr   environ
setdefaultr   Zconfig_from_objectZautodiscover_tasksconfupdatetaskr   r   r   r   r   r   <module>   s@    !

