o
    Df 
                     @   s   d Z ddlmZ ddlZddlmZmZmZmZ ddl	m
Z
mZ ejeddidejd	edd
dddejddedd dddejddedd dddejdeedddejdddeedddeje		d"d d!ZdS )#z#The :program:`celery beat` command.    )partialN)	LOG_LEVELCeleryDaemonCommandCeleryOptionhandle_preload_options)detachedmaybe_drop_privilegesallow_extra_argsT)clscontext_settingsz--detachFzBeat Optionsz-Detach and run in the background as a daemon.)r
   is_flagdefault
help_grouphelpz-sz
--schedulec                 C      |p| j jjjS N)objappconfbeat_schedule_filenamectx_value r   H/home/ubuntu/webapp/venv/lib/python3.10/site-packages/celery/bin/beat.py<lambda>       r   zvPath to the schedule database.  Defaults to `celerybeat-schedule`.The extension '.db' may be appended to the filename.)r
   callbackr   r   z-Sz--schedulerc                 C   r   r   )r   r   r   beat_schedulerr   r   r   r   r      r   zScheduler class to use.z--max-intervalz1Max seconds to sleep between schedule iterations.)r
   typer   r   z-lz
--loglevelWARNINGzLogging level.)r   r
   r    r   r   c              
   K   s   | j j}	| jr(z|	| j W n ttfy' }
 z
tjd|
 | dd}
~
ww |s0t||d t	|	j
f||| j jd|}|rat|||||| |  W  d   S 1 sZw   Y  dS |  S )z'Start the beat periodic task scheduler.z?Unable to parse extra configuration from command line.
Reason: )r   N)uidgid)logfilepidfilequiet)r   r   argsconfig_from_cmdlineKeyError
ValueErrorclick
UsageErrorr   r   Beatr&   r   run)r   detachr$   r%   r"   r#   umaskworkdirkwargsr   ebeatr   r   r   r4   
   s2   ($
r4   )FNNNNNN)__doc__	functoolsr   r+   celery.bin.baser   r   r   r   celery.platformsr   r   commandoptionintpass_contextr4   r   r   r   r   <module>   s`    