Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/rads/__pycache__/_locking.cpython-39.pyc
Ðазад
a � h � @ s� d Z ddlZddlZddlZddlZddlmZ ddlZG dd� de �Z ejdee d�dd��Z d e _ejdee eee d�dd ��Zd e_dS )z&Functions for acquiring a process lock� N)�Optionalc @ s e Zd ZdZdZdS )� LockErrorz*Raised when a rads.lock cannot be acquired�radsN)�__name__� __module__�__qualname__�__doc__� r r �</opt/imh-python/lib/python3.9/site-packages/rads/_locking.pyr s r )�namec c s� | du rt j} | �d�} t�tjtj�}z|�dt�| �� � � W n0 tj yt } zt| �|�W Y d}~n d}~0 0 zdV W |�� n |�� 0 dS )a� Context manager to create an abstract UNIX socket which will behave as a "lock". This can be used en lieu of /var/run file pids/locks to determine if an instance of a process is already running and ensure the lock is not left behind if the process terminates prematurely Args: name: unique name of the lock; defaults to filename of ``__main__`` Raises: LockError: if the "lock" already existed Nzutf-8z %s) �main_obj�__file__�encode�socket�AF_UNIX� SOCK_DGRAM�bind�hashlib�sha256� hexdigest�errorr �close)r Zlock_socket�excr r r �lock s r r 皙�����?)r �sleep� max_sleepc c sx d}z6t | �� dV W d � W dS 1 s.0 Y W q typ t�|� ||7 }|durl||krl� Y q0 qdS )aQ Context manager to wait until a rads.lock() can be acquired, and do so Args: name: unique name of the lock; defaults to filename of ``__main__`` sleep: secs before trying to acquire the lock again max_sleep: max number of tries to acquire the lock Raises: LockError: if max_sleep is exceeded g N)r r �timer )r r r Zsleptr r r � wait_lock/ s & r )N)Nr N)r r r � contextlibr �typingr �__main__r � Exceptionr �contextmanager�strr r �float�intr r r r r �<module> s( ��
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка