� J�g����ddlmZddlmZmZmZmZmZmZm Z ddl m Z m Z m Z erddlmZe d��ZGd�d��ZdS) �)�sleep)� TYPE_CHECKING�Any� Awaitable�Callable�Tuple�Type�TypeVar)�ConnectionError� RedisError� TimeoutError)�AbstractBackoff�Tc ��eZdZdZdZeeffdddedee e dffd�Z d e fd �Z d egeefd ee gefd efd�ZdS)�Retryz0Retry a specific number of times after a failure��_backoff�_retries�_supported_errors�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. Nr)�selfrrrs �c/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/redis/asyncio/retry.py�__init__zRetry.__init__s ��  �� ��� �!1������specified_errorsc�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�fail�returnc��VK�|j���d} |���d{V��S#|j$rm}|dz }||���d{V��|jdkr ||jkr|�|j�|��}|dkrt |���d{V��Yd}~nd}~wwxYw��)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 rTN�)r�resetrr�computer)rr#r$�failures�errorrs r�call_with_retryzRetry.call_with_retry.s����� � �������� )� )��R�T�T�z�z�z�z�z�z�!���)� )� )� )��A� ���d�5�k�k�!�!�!�!�!�!�!��=�A�%�%�(�T�]�*B�*B��K��-�/�/��9�9���Q�;�;���.�.�(�(�(�(�(�(�(���������� )���� )s�0� B'�A#B"�"B'N)�__name__� __module__� __qualname__�__doc__� __slots__r r �intrr r r�listr"rrrrr,�rrrr s�������:�:�;�I� � �: � 2�2�"�2��2� ��Z� 0�#� 5�6� 2�2�2�2�( �� � � � �)��2�y��|�+�,�)�4<�j�\�3�=N�4O�)� �)�)�)�)�)�)rrN)�asyncior�typingrrrrrr r �redis.exceptionsr r r � redis.backoffrrrr4rr�<module>r9s���������P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�F�F�F�F�F�F�F�F�F�F��.�-�-�-�-�-�-� �G�C�L�L��6)�6)�6)�6)�6)�6)�6)�6)�6)�6)r
Memory