� M�gw��\�ddlZddlZddlZddlmZddlmZmZmZd�Zd�Z d�Z d�Z d�Z dS) �N)� timedelta)�_init_wait_gen� _maybe_call� _next_waitc�r��tj���r�Stj����fd���}|S)Nc���K��|i|��S)N�)�args�kwargs� coro_or_funcs ��^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/backoff/_async.py�fz_ensure_coroutine.<locals>.fs������<��0��0�0� 0�)�asyncio�iscoroutinefunction� functools�wraps)r rs` r �_ensure_coroutiner sO����"�<�0�0���� ��� &� &� 1� 1� 1� 1� '� &� 1��rc��d�|D��S)Nc�,�g|]}t|����Sr )r)�.0rs r � <listcomp>z&_ensure_coroutines.<locals>.<listcomp>s!�� 9� 9� 9�Q� �a� � � 9� 9� 9rr )�coros_or_funcss r �_ensure_coroutinesrs�� 9� 9�.� 9� 9� 9�9rc��pK�|||||d�}|�|��|D]}||���d{V���dS)N��targetr r �tries�elapsed)�update) �handlersrr r rr�extra�details�handlers r �_call_handlersr%su���� ����� ��G� �N�N�5���������g�g������������rc �H���������� �t����t����t����tj���rJ�tj���rJ�tj���sJ�tj������������� f d���} | S)Nc���� K�t���}t���}d}tj���}t����} |dz }t jtj���|z ��}�||||d�}�|i|���d{V��} �| ��r�||k} |duo||k} | s| rt �fi|�d| i���d{V��n� t|| � ||��} n'#t$rt �fi|�d| i���d{V��YnOwxYwt �fi|�| | d����d{V��tj | ���d{V����t �fi|�d| i���d{V�� | S)NrT�r�value)r)�wait� r�datetime�nowrr� total_secondsr%r� StopIterationr�sleep)r r �max_tries_value�max_time_valuer�startr*rr#�ret�max_tries_exceeded�max_time_exceeded�seconds�jitter�max_time� max_tries� on_backoff� on_giveup� on_success� predicater�wait_gen�wait_gen_kwargss ����������r �retryzretry_predicate.<locals>.retry7sg�����&�i�0�0��$�X�.�.�����!�%�%�'�'���h��8�8��, � �Q�J�E��-�h�.?�.C�.C�.E�.E��.M�N�N�G� �� ��"� ��G����/��/�/�/�/�/�/�/�/�C��y��~�~� �&+��&>�"�%3�4�%?�&?�%,��%>�"�&��):��(��I�I�g�I�I�S�I�I�I�I�I�I�I�I�I�I���(��s�F�G�)7�9�9�G�G��$����(��I�I�g�I�I�S�I�I�I�I�I�I�I�I�I�I��E�����%�Z�3�3�7�3�#�*1�3�3�3�3�3�3�3�3�3�3�3��m�G�,�,�,�,�,�,�,�,�,��$�Z�F�F�7�F�F�#�F�F�F�F�F�F�F�F�F�F��� s�C-�-!D�D)rrrrr) rr?r>r:r9r8r=r;r<r@rAs `````````` r �retry_predicaterB(s������������� $�J�/�/�J�#�J�/�/�J�"�9�-�-�I��*�9�5�5�5�5� 5��*�6�2�2�2�2� 2� � &�v� .� .�.�.� .��_�V���7�7�7�7�7�7�7�7�7�7�7�7�7���7�r �Lrc �B���������� � � �t����t����t� ��� t����tj���rJ�tj���rJ�t j���������� �� ��� f d���} | S)Nc��� K�t���}t���}d}tj���}t����} |dz }t jtj���|z ��}�||||d�} �|i|���d{V��} t �fi|���d{V��| S#�$r�} �| ���d{V��} ||k} |duo||k} | s| s| r t �fi|�d| i���d{V���r�Yd} ~ dS t|| �||��}n'#t$rt �fi|�d| i���d{V��| �wxYwt �fi|�|| d����d{V��tj |���d{V��Yd} ~ nd} ~ wwxYw��-)NrTr(r� exception)r*rEr+)r r r1r2rr3r*rr#r4�e� giveup_resultr5r6r7rE�giveupr8r9r:r;r<r=�raise_on_giveuprr?r@s ������������r rAzretry_exception.<locals>.retry�s������&�i�0�0��$�X�.�.�����!�%�%�'�'���h��8�8��0 � �Q�J�E��-�h�.?�.C�.C�.E�.E��.M�N�N�G� �� ��"� ��G�% �"�F�D�3�F�3�3�3�3�3�3�3�3��D%�Z�;�;�7�;�;�;�;�;�;�;�;�;�� ��G� -� -� -�&,�f�Q�i�i������� �&+��&>�"�%3�4�%?�&?�%,��%>�"�!� �$6� �:K� �(��K�K�g�K�K��K�K�K�K�K�K�K�K�K�K�&����4�4�4�4�4��(��q�&�'�)7�9�9�G�G��$����(��K�K�g�K�K��K�K�K�K�K�K�K�K�K�K��G�����%�Z�2�2�7�2��/0�2�2�2�2�2�2�2�2�2�2�2��m�G�,�,�,�,�,�,�,�,�,�,�,�,�,�,�����? -����0 s1�B7�7E;�<AE6�D�E6�$D<�<5E6�6E;)rrrrrr) rr?rEr:r9r8rHr=r;r<rIr@rAs ```````````` r �retry_exceptionrJts��������������� $�J�/�/�J�#�J�/�/�J�"�9�-�-�I� �v� &� &�F��*�9�5�5�5�5� 5��*�6�2�2�2�2� 2��_�V���8�8�8�8�8�8�8�8�8�8�8�8�8�8�8���8�r �Lr) r,rrr�backoff._commonrrrrrr%rBrJr rr �<module>rLs���������������������E�E�E�E�E�E�E�E�E�E����:�:�:� � � � I�I�I�XH�H�H�H�Hr
Memory