HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/xray/internal/__pycache__/fpm_utils.cpython-37.pyc
B

�*Ud��@sZddlmZddlmZddlmZmZddlmZddl	m
Z
mZeGdd�d��Zd	S)
�)�	dataclass)�Optional�)�fpm_stat_storage�fpm_reload_timeout)�	XRayError)�dbm_storage�	timestampc@sTeZdZUdZeed<eeed�dd��Z	dd�Z
ed�dd	�Ze
d�d
d�ZdS)
�FPMReloadControllerzA
    Class to control the frequency of FPM service reloading
    �fpm_service)�returnc
Cszy@tt��.}yt||j���Stk
r2dSXWdQRXWn4tk
rt}ztd|��dd��Wdd}~XYnXdS)zC
        Get the timestamp of latest reload of FPM service
        Nz2Failed to get the timestamp of latest FPM reload: �warning)�flag)rr�intr�decode�KeyError�RuntimeErrorr)�self�_fpm_reload_stat�e�r�H/opt/alt/python37/lib/python3.7/site-packages/xray/internal/fpm_utils.py�
latest_reloads
z!FPMReloadController.latest_reloadc
Csdy(tt��}tt��||j<WdQRXWn6tk
r^}ztd|�d�dd��Wdd}~XYnXdS)zD
        Save the timestamp of latest reload of FPM service
        Nz2Failed to save the timestamp of latest FPM reload z, but main operation executedr
)r)rr�strr	rrr)rrrrrr�save_latest_reload's

z&FPMReloadController.save_latest_reloadc	Cs.yt�|jdSttfk
r(dSXdS)zM
        Get the time delta between current time and saved timestamp
        �<gN@N)r	r�	TypeErrorr)rrrr�delta4szFPMReloadController.deltacCs|��tkS)z7
        Check if FPM reload should be blocked
        )rr)rrrr�restrictAszFPMReloadController.restrictN)�__name__�
__module__�__qualname__�__doc__r�__annotations__�propertyrrrr�floatr�boolrrrrrr
s


r
N)
�dataclassesr�typingr�	constantsrr�
exceptionsr�utilsrr	r
rrrr�<module>s