HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/celery/bin/__pycache__/worker.cpython-39.pyc
a

X>hV2�%@s�dZddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZddlmZddlmZdd	lmZmZmZmZdd
lmZddlmZmZmZee�ZGdd
�d
e�Z Gdd�dej!�Z"Gdd�de�Z#Gdd�de�Z$e �Z%e"�Z&e#�Z'e$�Z(ej)�*d�Z+dodd�Z,ej-eddid�ej.ddeed��e
e'ddd�ej.d d!e
dddd"d#�ej.d$d%e
e�/�d&d'�dd(d)�ej.d*d+d,e
edd-d�ej.d.d/d0e
e�!d1�dd2d�ej.d3e0d4d5d'�e
dd6d7�ej.d8d9e0d:d;d'�e
d<d=d7�ej.d>d?d@e&e
d<dAdB�ej.dCdDdEdde
d<dFdG�ej.dHe1e
d<dIdJ�ej.dKe1e
d<dLdJ�ej.dMe0e
d<dNdJ�ej.dOe0e
d<dPdJ�ej.dQdRde
dSdT�ej.dUdVe
e
dSdW�ej.dXdYe
e
dSdW�ej.dZd[e
e
dSdW�ej.d\de
d]dT�ej.d^de
d]dT�ej.d_de
d]dT�ej.d`e0e
d]dW�ej.dae(e
d]dW�ej.dbdce%e
dddde�ej.dfdgdhdid'�e
dddj�ej.dke
dddl�ej2edpdmdn�����������������������������Z3dS)qz/Program used to start a Celery worker instance.�N)�	ParamType)�StringParamType)�concurrency)�COMMA_SEPARATED_LIST�	LOG_LEVEL�CeleryDaemonCommand�CeleryOption�handle_preload_options)�BasePool)�
SecurityError)�
EX_FAILURE�EX_OK�detached�maybe_drop_privileges)�
get_logger)�default_nodename�host_format�node_formatc@seZdZdZdZdd�ZdS)�
CeleryBeatzCelery Beat flag.ZbeatcCs|jjjr|r|�d�|S)NzR-B option does not work on Windows.  Please run celery beat as a separate service.)�obj�appZ
IS_WINDOWS�fail��self�value�param�ctx�r�;/usr/local/lib/python3.9/site-packages/celery/bin/worker.py�converts
zCeleryBeat.convertN��__name__�
__module__�__qualname__�__doc__�namerrrrrrsrcs0eZdZdZdZ�fdd�Z�fdd�Z�ZS)�WorkersPoolzWorkers pool option.�poolcst��t���dS)z=Initialize the workers pool option with the relevant choices.N)�super�__init__rZget_available_pool_names)r��	__class__rrr)(szWorkersPool.__init__csht|t�rt|t�r|St��|||�}|jjjj	}|dkrL|rLt
�|�}nt
�|�}|sdt
�|�}|S)N�prefork)�
isinstance�type�
issubclassr
r(rrr�conf�worker_poolrZget_implementation)rrrrr1r*rrr,s

zWorkersPool.convert)r!r"r#r$r%r)r�
__classcell__rrr*rr&#sr&c@seZdZdZdZdd�ZdS)�HostnamezHostname option.�hostnamecCstt|��S�N)rrrrrrrGszHostname.convertNr rrrrr3Bsr3c@seZdZdZdZdd�ZdS)�	AutoscalezAutoscaling parameter.z<min workers>, <max workers>c	Cs�|�d�}t|�dkr,|�dt|��d��t|�dkrrzt|d�df}Wn$typ|�d|�d��Yn0zttttt|����WSty�|�d|�	d��d��Yn0dS)	N�,�z9Expected two comma separated integers or one integer.Got z	 instead.�rzExpected an integer. Got z*Expected two comma separated integers.Got )
�split�lenr�int�
ValueError�tuple�reversed�sorted�map�joinrrrrrPs 
�
�zAutoscale.convertNr rrrrr6Ksr6�
C_FAKEFORKFc

Cs�trdn|}t||�}t|||||||dd���z2|
dur>|
}t�||g|�tWWd�Sty�|	dur�ddlm}|}	|	j	j
d||d�tjd	d
�
|g|�dd�tYWd�S0Wd�n1s�0YdS)
zDetach program by argv.r9F)Z
after_forkersNr)�current_app�ERROR)r4z
Can't exec %r� T)�exc_info)rCrr�os�execvr
�	Exception�celeryrD�logZsetup_logging_subsystem�logger�criticalrBr)
�path�argv�logfile�pidfile�uid�gid�umask�workdirZfaker�
executabler4rDrrr�detachls*
���rXZallow_extra_argsT)�clsZcontext_settingsz-nz
--hostnamezWorker Optionsz]Set custom hostname (e.g., 'w1@%%h').  Expands: %%h (hostname), %%n (name) and %%d, (domain).)�defaultrYr.�
help_group�help�-D�--detachz%Start worker as a background process.)rY�is_flagrZr[r\z-Sz	--statedbcCs|p|jjjjSr5)rrr0Zworker_state_db�r�_rrrr�<lambda>�srbzPPath to the state database. The extension '.db' may be appended to the filename.)rYr.�callbackr[r\z-lz
--loglevel�WARNINGzLogging level.z-Oz--optimizationrZ)rZZfairzApply optimization profile.z--prefetch-multiplierz<prefetch multiplier>cCs|p|jjjjSr5)rrr0Zworker_prefetch_multiplierr`rrrrb�sz>Set custom prefetch multiplier value for this worker instance.)r.�metavarrcrYr[r\z-cz
--concurrencyz
<concurrency>cCs|p|jjjjSr5)rrr0Zworker_concurrencyr`rrrrb�szPool OptionszlNumber of child processes processing the queue.  The default is the number of CPUs available on your system.z-Pz--poolr,zPool implementation.)rZr.rYr[r\z-Ez
--task-eventsz--eventszdSend task-related events that can be captured by monitors like celery events, celerymon, and others.)r_rZrYr[r\z--time-limitz;Enables a hard time limit (in seconds int/float) for tasks.)r.rYr[r\z--soft-time-limitz;Enables a soft time limit (in seconds int/float) for tasks.z--max-tasks-per-childzfMaximum number of tasks a pool worker can execute before it's terminated and replaced by a new worker.z--max-memory-per-childaMaximum amount of resident memory, in KiB, that may be consumed by a child process before it will be replaced by a new one.  If a single task causes a child process to exceed this limit, the task will be completed and the child process will be replaced afterwards.
Default: no limit.z--purgez	--discardz
Queue Options)r_rYr[z--queuesz-Q)r.rYr[z--exclude-queuesz-Xz	--includez-Iz--without-gossipZFeaturesz--without-minglez--without-heartbeatz--heartbeat-intervalz--autoscalez-Bz--beatzEmbedded Beat Options)r.rYr_r[z-sz--schedule-filenamez
--schedulecCs|p|jjjjSr5)rrr0Zbeat_schedule_filenamer`rrrrb!s)rcrYr[z--scheduler)rYr[c
Ks��z`|jj}|jrdz|j|jdd�Wn<ttfyb}z tjd|��|d��WYd}~n
d}~00|
�dd��r
dd	gt	j
d
d�}d|vr�|�d�d|vr�|�d�d
|vr�|�d
�d|vr�|�d�tt	j
||||||
�dd�|
�dd�||
�dd�|d�WSt||d�|jf||||t||�t|	|�|jj|jjd�|
��}
|
��|�|
j�WnBt�y�}z(|j�|jd�|�d
�WYd}~n
d}~00dS)a*Start worker instance.

    
    Examples
    --------

    
    $ celery --app=proj worker -l INFO
    $ celery -A proj worker -l INFO -Q hipri,lopri
    $ celery -A proj worker --concurrency=4
    $ celery -A proj worker --concurrency=1000 -P eventlet
    $ celery worker --autoscale=10,0

    �worker)�	namespacez?Unable to parse extra configuration from command line.
Reason: )rNrXFz-mrKr9r^r]z--uidz--gidrUrVrW)	rQrRrSrTrUrVrrWr4)rSrT)r4�pool_cls�loglevelrQrR�statedb�no_color�quietr)rr�argsZconfig_from_cmdline�KeyErrorr=�clickZ
UsageError�get�sysrP�removerXrWrZWorkerrrkrl�start�exit�exitcoder�error)rr4rhrrSrTrirQrRrj�kwargs�erPrfrrrrf�sd4��






���rf)
NNNNNNFNNN)	NNNNNNNNN)4r$rHrqrorZclick.typesrrKrZcelery.bin.baserrrrr	Zcelery.concurrency.baser
Zcelery.exceptionsrZcelery.platformsrr
rrZcelery.utils.logrZcelery.utils.nodenamesrrrr!rMrZChoicer&r3r6ZCELERY_BEATZWORKERS_POOL�HOSTNAMEZ	AUTOSCALE�environrprCrX�command�option�Pathr<�floatZpass_contextrfrrrr�<module>s�
	�
�
���	���	���	����
�������������