� J�g����ddlZddlmZddlmZmZmZmZmZm Z m Z ddl m Z m Z e d��ZerddlmZGd�d��ZdS) �N)�sleep)� TYPE_CHECKING�Any�Callable�Iterable�Tuple�Type�TypeVar)�ConnectionError� TimeoutError�T)�AbstractBackoffc ��eZdZdZeeejffdddede e e dffd�Z de e e d d fd �Zd egefd ee gefd efd�Zd S)�Retryz0Retry a specific number of times after a failure�backoffr�retries�supported_errors.c�0�||_||_||_dS)a' Initialize a `Retry` object with a `Backoff` object that retries a maximum of `retries` times. `retries` can be negative to retry forever. You can specify the types of supported errors which trigger a retry with the `supported_errors` parameter. N)�_backoff�_retries�_supported_errors)�selfrrrs �[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/redis/retry.py�__init__zRetry.__init__s ��" �� ��� �!1������specified_errors�returnNc�r�tt|jt|��z����|_dS)zM Updates the supported errors with the specified error types N)�tuple�setr)rrs r�update_supported_errorszRetry.update_supported_errors%s8�� "'� ��&��/?�)@�)@�@� A� A�" �" ����r�do�failc�.�|j���d} |��S#|j$ra}|dz }||��|jdkr ||jkr|�|j�|��}|dkrt |��Yd}~nd}~wwxYw�z)a& Execute an operation that might fail and returns its result, or raise the exception that was thrown depending on the `Backoff` object. `do`: the operation to call. Expects no argument. `fail`: the failure handler, expects the last error that was thrown rT�N)r�resetrr�computer)rr"r#�failures�errorrs r�call_with_retryzRetry.call_with_retry/s��� � �������� #� #��r�t�t� ���)� #� #� #��A� ����U� � � ��=�A�%�%�(�T�]�*B�*B��K��-�/�/��9�9���Q�;�;��'�N�N�N���������� #���� #s� (� B�AB�B)�__name__� __module__� __qualname__�__doc__r r �socket�timeout�intrr � Exceptionrrr!rr rr*�rrrr s�������:�:� � � �N�9 � 2�2�"�2��2� ��Y��� 4�5� 2�2�2�2�* � (��i�� 9� � � � � � �#� �R��U�O�#�� �{�C�'�(�#� � #�#�#�#�#�#rr)r/�timer�typingrrrrrr r �redis.exceptionsr r r � redis.backoffrrr3rr�<module>r8s��� � � � �������O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�:�:�:�:�:�:�:�:� �G�C�L�L���.�-�-�-�-�-�-�9#�9#�9#�9#�9#�9#�9#�9#�9#�9#r
Memory