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/worker/__pycache__/strategy.cpython-39.pyc
a

X>h��@s�dZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZdd
lmZddlmZdd
lmZdZee�Zdd�Zdd�Zejejeejeefdd�Z dS)z'Task execution strategy (optimization).�N)�to_timestamp)�signals)�trace)�InvalidTaskError)�symbol_by_name)�
get_logger)�saferepr)�timezone�)�create_request_cls)�
task_reserved)�defaultcCs$z$|�dd�|�di�}}|jWn2ty>td��YntyVtd��Yn0|�d�|�d�|�d�|�d	�|�d
�|�d�|�d�|�d
�|�d�|�d�|�dd�|�dd�|�d�|�d�|�d�d�}|�|jp�i�|�d�|�d�|�d�dd�}|||f|d|�dd�fS)zECreate a fresh protocol 2 message from a hybrid protocol 1/2 message.�args��kwargs�!Message does not have args/kwargs�(Task keyword arguments must be a mapping�lang�task�id�root_id�	parent_id�group�meth�shadow�eta�expires�retriesr�	timelimit)NN�argsrepr�
kwargsrepr�origin)rrrrrrrrrrrrrr r!�	callbacks�errbacks�chordN�r"r#r$�chainT�utc)�get�items�KeyErrorr�AttributeError�update�headers)�message�bodyrrr-�embedrr�@/usr/local/lib/python3.9/site-packages/celery/worker/strategy.py�hybrid_to_proto2s@
�


��r2cCs�z$|�dd�|�di�}}|jWn2ty>td��YntyVtd��Yn0|jt|�t|�|jd�z|d|d<Wnty�Yn0|�d	�|�d
�|�d�dd
�}|||f|d|�dd�fS)z�Convert Task message protocol 1 arguments to protocol 2.

    Returns:
        Tuple: of ``(body, headers, already_decoded_status, utc)``
    rrrrr)rr r-Ztasksetrr"r#r$Nr%Tr')r(r)r*rr+r,rr-)r.r/rrr0rrr1�proto1_to_proto2Bs0
�
��r3c	s��j��j�t�tj���j��o&�j}	�o0�j�|	o:�j	��j
j��j��j
��jj�	�j�
�j��j�
t�j�}
t|
��j���d���jjj�tf����������	�
���
����������fdd�	��S)z�Default task execution strategy.

    Note:
        Strategies are here as an optimization, so sadly
        it's not very easy to override.
    )�appc
sb|dur0d|jvr0|j|jd���f\}}}}n2d|jvrPt||j�\}}}}n�||�\}}}}�|||���	��||||d���r��j�j�j�j�j	d�}	�
t
j|	d|	id��jsĈj�vrЈ�
�r�dStjj��d���r4�d�j�j�j�j�j�j�j�d	d
��j	�o�j	���j�o.�j��d�
d}
d}�j	�r�z*�j�r^|��j	��}n|�j	�j�}WnRttf�y�}z4�d�j	|�jd
d�d
d��jdd�WYd}~n
d}~00��r҈
�j�}
|�r�|
�r��j���|��|
dfdd�S|�r$�j���|��fdd��S|
�r6��|
d�S���|�rV�fdd�|D����dS)NrF)Zon_ackZ	on_rejectr4�hostname�eventerr�connection_errorsr/r-�decodedr')r�namerrr�data)�extra)Zsender�requestz
task-receivedrr)	�uuidr9rrrrrrrz2Couldn't convert ETA %r to timestamp: %r. Task: %rT)�safe)�exc_info)Zrequeuer
�)�prioritycsg|]}|���qSrr)�.0�callback��reqrr1�
<listcomp>��z9default.<locals>.task_message_handler.<locals>.<listcomp>)�payloadr/r-Zuses_utc_timezoner2rr9rr r�
_app_traceZLOG_RECEIVEDr�revokedrZ
task_received�sendrrZrequest_dictr(�	isoformatr'r	�
OverflowError�
ValueError�info�rejectZqosZincrement_eventually)
r.r/ZackrPr"rr-r8r'�contextZbucketr�exc�ZReqZ
_does_infor4�apply_eta_task�call_atr7�consumer�errorr6Z
get_bucket�handler5rOZlimit_post_etaZ
limit_taskr3Zrate_limits_enabledZ
revoked_tasksZ
send_eventr�task_message_handlerrZtask_sends_events�to_system_tzrDr1rY�s��
����
�"

�
z%default.<locals>.task_message_handler)r5r7�logger�isEnabledFor�logging�INFOZevent_dispatcher�enabledrKZsend_events�timerrUrTZdisable_rate_limitsZtask_buckets�__getitem__Zon_task_requestZ_limit_taskZ_limit_post_etar�Requestr�pool�
controller�staterJr)rr4rVrOrWrrZ�bytesr3�eventsrbrrSr1r
cs(





�<Lr
)!�__doc__r]Zkombu.asynchronous.timerrZceleryrZ
celery.apprrIZcelery.exceptionsrZcelery.utils.importsrZcelery.utils.logrZcelery.utils.safereprrZcelery.utils.timer	r<rrer�__all__�__name__r[r2r3rOrWZ	to_systemrfr
rrrr1�<module>s&)"
�