
    !+i                         d dl Z d dlmZ d dlmZ  e j
                  e      Zd dlm	Z	 d dl
mZ d Zd dlmZmZmZ d dlmZmZ d	 Zy)
    N)BlockingScheduler)CronTrigger)SessionLocal)DataProcessorServicec                      t         j                  d       t               } 	 t        |       }|j	                          | j                          y # t
        $ r"}t         j                  d|        Y d }~7d }~ww xY w# | j                          w xY w)NzStarting daily sync job...zJob failed: )loggerinfor   r   sync_daily_data	Exceptionerrorclose)dbservicees      @/var/www/hypershopcomercio.com.br/hyper-ai/app/scheduler/jobs.pyrun_daily_syncr   
   sp    
KK,-	B&r*! 	
  )|A3'(() 	
s)   A 	A8A3.A; 3A88A; ;B)run_daily_predictionsrun_hourly_reconciliationrun_weekly_calibration)execute_pricing_strategiesverify_recent_price_changesc                     t               } | j                  t        t        dd             | j                  t        t        dd             | j                  t
        t        d             | j                  t        t        dd             | j                  t        t        d             | j                  t        t        d             t        j                  d	       	 | j                          y # t        t        f$ r Y y w xY w)
N   r   )hourminute   z*/30)r      
   z6Scheduler started with Forecast Automation (Hourly)...)r   add_jobr   r   r   r   r   r   r   r   r	   startKeyboardInterrupt
SystemExit)	schedulers    r   start_schedulerr$      s    !#I nkq&CD 0+1Q2OP 1;f3MN +[a-JK /A1FG ,k.DE
KKHIz* s   $C5 5DD)loggingapscheduler.schedulers.blockingr   apscheduler.triggers.cronr   	getLogger__name__r   app.core.databaser   app.services.data_processorr   r   app.jobs.forecast_jobsr   r   r   app.jobs.pricing_jobr   r   r$        r   <module>r0      s@     = 1			8	$ * <	 
 Yr/   