o
    jEi                     @   sL   d dl Z d dlmZ ddlmZ d dlZe eZej	dddd	d
Z
dS )    N)
celery_app   )run_keepa_scriptz"keepa_deals.tasks.run_keepa_script)nameFdatac              
   C   sd   t d}|std dS zt|| |ddd W dS  ty1 } ztjd| dd  d}~ww )z
    Celery task wrapper for the main Keepa script.
    It retrieves the API key from environment variables and calls the main function.
    KEEPA_API_KEYz6KEEPA_API_KEY not found in environment. Aborting task.N)api_keyno_cache
output_dir
deal_limitstatus_update_callbackz7An error occurred while running the Keepa script task: T)exc_info)osgetenvloggererrorrun_keepa_script_main	Exception)r	   r
   r   e r   ,/var/www/agentarbitrage/keepa_deals/tasks.pyrun_keepa_script_task	   s"   

r   )Fr   )loggingr   Keepa_Dealsr   r   r   	getLogger__name__r   taskr   r   r   r   r   <module>   s   

