AlkantarClanX12

Your IP : 13.59.183.186


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/internal/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/internal/__pycache__/tools.cpython-311.pyc

�

9�1g
	����ddlZddlZddlZddlmZmZmZddlmZm	Z	ddl
mZejd��Z
ded	dfd
�Zded	dfd�Zdeded	dfd
�Zd�Zdefdeeefded	dfd�ZdS)�N)�Union�Iterable�Callable�)�switch_schedstats�no_xray_active_tasks�)�RequestProcessor�tools�signum�returnc�>�t�d||��dS)z/
    Signal handler to log received signal
    zReceived sig: %i (%s)N)�logger�info�r�frames  �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/internal/tools.py�log_on_receivers!���K�K�'���8�8�8�8�8�c�J�t�d|��t�����t�d|��t	��r*t�d��td���t
jd��dS)zO
    Signal handler to dump collected statistics and switch off schedstats
    zReceived sig: %iz/Dumped successfully after %i signal, exiting...z0No X-Ray tasks running, switching schedstats offF)�enabledrN)rrr
�flush_bufferrr�sys�exitrs  r�sigterm_receivedrs����K�K�"�F�+�+�+����#�#�%�%�%�
�K�K�A�6�J�J�J����)����F�G�G�G��%�(�(�(�(��H�Q�K�K�K�K�Kr�
sighandlerc���	tj||��t�d|��dS#ttf$r'}t�d||��Yd}~dSd}~wwxYw)z4
    Register given sighandler for given signum
    z
Registered %szSkipped %s because of %sN)�signalrr�OSError�
ValueError)rr�es   r�register_a_signalr")s���;��
�f�j�)�)�)����O�V�,�,�,�,�,���Z� �;�;�;����.���:�:�:�:�:�:�:�:�:�����;���s�04�A,�A'�'A,c�D�ttjt��dS)z4
    Register a dump handler for SIGTERM signal
    N)r"r�SIGTERMr�rr�register_sigtermr&4s���f�n�&6�7�7�7�7�7r�signals�handlerc���|�!tjD]}t||���dSt|t��rt||��dS|D]}t||���dS)z�
    Register given handler for given signal or range of signals
    If no signals given, add given handler for all available signals
    N)r�Signalsr"�
isinstance�int)r'r(�sigs   r�register_signalsr.;s������>�	,�	,�C��c�7�+�+�+�+�	,�	,��g�s�#�#�	0��g�w�/�/�/�/�/��
0�
0��!�#�w�/�/�/�/�
0�
0r)�loggingrr�typingrrr�utilsrr�modules.processorr
�	getLoggerrr,rrr"r&r.r%rr�<module>r4sC������
�
�
�
�
�
�
�
�,�,�,�,�,�,�,�,�,�,�:�:�:�:�:�:�:�:�0�0�0�0�0�0�	��	�7�	#�	#��9�3�9�$�9�9�9�9��S��D�����;�c�;�x�;�D�;�;�;�;�8�8�8�6:�)7�0�0�e�C��M�2�0�&�0�<@�0�0�0�0�0�0r