Ë
    §Œj“  ã                   óä   — d dl Z d dlZd dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZ d dlmZmZ  ed«      Z eded¬«      Zerd d	lmZ  G d
„ dee   e j.                  «      Z G d„ dee   «      Zy)é    N)Úsleep)
ÚTYPE_CHECKINGÚAnyÚCallableÚGenericÚIterableÚOptionalÚTupleÚTypeÚTypeVarÚUnion)ÚConnectionErrorÚTimeoutErrorÚTÚET)ÚboundÚ	covariant)ÚAbstractBackoffc                   óÂ   — e Zd ZU dZeee   df   ed<   dddedeee   df   fd„Z	e
j                  d	ed
efd„«       Zd
efd„Zdeee      d
dfd„Zd
efd„Zded
dfd„Zy)ÚAbstractRetryz0Retry a specific number of times after a failure.Ú_supported_errorsÚbackoffr   ÚretriesÚsupported_errorsc                 ó.   — || _         || _        || _        y)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Ú_retriesr   )Úselfr   r   r   s       úU/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/redis/retry.pyÚ__init__zAbstractRetry.__init__   s   € ð  ˆŒØˆŒØ!1ˆÕó    ÚotherÚreturnc                 ó   — t         S ©N)ÚNotImplemented©r   r"   s     r   Ú__eq__zAbstractRetry.__eq__0   s   € äÐr!   c                 ól   — t        | j                  | j                  t        | j                  «      f«      S r%   )Úhashr   r   Ú	frozensetr   ©r   s    r   Ú__hash__zAbstractRetry.__hash__4   s'   € Ü�T—]‘] D§M¡M´9¸T×=SÑ=SÓ3TÐUÓVÐVr!   Úspecified_errorsNc                 ób   — t        t        | j                  t        |«      z   «      «      | _        y)zM
        Updates the supported errors with the specified error types
        N)ÚtupleÚsetr   )r   r.   s     r   Úupdate_supported_errorsz%AbstractRetry.update_supported_errors7   s*   € ô "'Ü�×&Ñ&¬Ð/?Ó)@Ñ@ÓAó"
ˆÕr!   c                 ó   — | j                   S )z,
        Get the number of retries.
        ©r   r,   s    r   Úget_retrieszAbstractRetry.get_retries?   s   € ð �}‰}Ðr!   Úvaluec                 ó   — || _         y)z,
        Set the number of retries.
        Nr4   )r   r6   s     r   Úupdate_retrieszAbstractRetry.update_retriesE   s   € ð ˆ�r!   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   Ú__annotations__Úintr    ÚabcÚabstractmethodr   Úboolr(   r-   r   r2   r5   r8   © r!   r   r   r      s·   … Ù:à˜T !™W c˜\Ñ*Ó*ð2à"ð2ð ð2ð    Q¡¨ Ñ-ó	2ð" 	×Ñð˜Cð  Dò ó ððW˜#ó Wð
¸ÀÀaÁÑ8Ið 
Èdó 
ð˜Só ð Cð ¨Dô r!   r   c                   óä   ‡ — e Zd Zej                  Zeeej                  ffddde	de
ee   df   fˆ fd„Zdedefd	„Z	 	 dd
eg ef   deeegef   eee	gef   f   deeegef      dedef
d„Zˆ xZS )ÚRetryr   r   r   r   .c                 ó(   •— t         ‰| �  |||«       y r%   )Úsuperr    )r   r   r   r   Ú	__class__s       €r   r    zRetry.__init__O   s   ø€ ô 	‰Ñ˜ 'Ð+;Õ<r!   r"   r#   c                 óð   — t        |t        «      st        S | j                  |j                  k(  xrF | j                  |j                  k(  xr+ t        | j                  «      t        |j                  «      k(  S r%   )Ú
isinstancerD   r&   r   r   r1   r   r'   s     r   r(   zRetry.__eq__[   sc   € Ü˜%¤Ô'Ü!Ð!ð �M‰M˜UŸ^™^Ñ+ò LØ—‘ §¡Ñ/òLä�D×*Ñ*Ó+¬s°5×3JÑ3JÓ/KÑKð	
r!   ÚdoÚfailÚis_retryableÚwith_failure_countc                 ód  — | j                   j                  «        d}	 	  |«       S # | j                  $ ry}|r	 ||«      s‚ |dz  }|r
 |||«       n ||«       | j                  dk\  r|| j                  kD  r|‚| j                   j	                  |«      }|dkD  rt        |«       Y d}~nd}~ww xY wŒ”)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
        ``is_retryable``: optional function to determine if an error is retryable
        ``with_failure_count``: if True, the failure count is passed to the failure handler
        r   é   N)r   Úresetr   r   Úcomputer   )r   rJ   rK   rL   rM   ÚfailuresÚerrorr   s           r   Úcall_with_retryzRetry.call_with_retrye   s¬   € ð 	�‰×ÑÔØˆØð#Ù“t�øØ×)Ñ)ò #Ù©°UÔ(;ØØ˜A‘�á%Ù˜ Õ)á˜”Kà—=‘= AÒ%¨(°T·]±]Ò*BØ�KØŸ-™-×/Ñ/°Ó9�Ø˜Q’;Ü˜'”Nÿøð#úð s   Ÿ& ¦B.µA/B)Â)B.)NF)r9   r:   r;   r   r-   r   r   ÚsocketÚtimeoutr>   r
   r   Ú	Exceptionr    r   rA   r(   r   r   r   r	   rT   Ú__classcell__)rG   s   @r   rD   rD   L   sà   ø„ Ø×%Ñ%€Hð ØØ�N‰Nð9
ñ	
=à"ð
=ð ð
=ð    Y¡°Ð 4Ñ5õ	
=ð
˜Cð 
 Dó 
ð ?CØ#(ñ"#à�R˜�U‰Oð"#ð �H˜i˜[¨#Ð-Ñ.°¸)ÀSÐ9IÈ3Ð9NÑ0OÐOÑPð"#ð ˜x¨¨°TÐ(9Ñ:Ñ;ð	"#ð
 !ð"#ð 
÷"#r!   rD   )r?   rU   Útimer   Útypingr   r   r   r   r   r	   r
   r   r   r   Úredis.exceptionsr   r   r   rW   r   Úredis.backoffr   ÚABCr   rD   rB   r!   r   Ú<module>r^      sg   ðÛ 
Û Ý ÷÷ ÷ ÷ ;áˆCƒL€ÙˆC�y¨DÔ1€áÝ-ô/�G˜A‘J §¡ô /ôd;#ˆM˜)Ñ$õ ;#r!   