
    LKi

                         S SK JrJr  S SKrS SKJrJrJrJr  S SK	J
r
   " S S\R                  \R                  5      rg)    )OptionalSetN)retrystop_after_attemptwait_exponential_jitterretry_if_result)Spanc                       \ rS rSr% Sr\\S'   \\R                     \S'   S\
" \R                  R                  \R                  R                  /5      4S\S\\R                     SS4S jjrS	 rS
 rS rS rS rSrg) RetryOnRpcErrorClientInterceptor   z
A gRPC client interceptor that retries RPCs on specific status codes. By default, it retries on UNAVAILABLE and UNKNOWN status codes.

This interceptor should be placed after the OpenTelemetry interceptor in the interceptor list.
max_attemptsretryable_status_codes   returnNc                     Xl         X l        g Nr   r   )selfr   r   s      V/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/chromadb/proto/utils.py__init__)RetryOnRpcErrorClientInterceptor.__init__   s     )&<#    c                    ^ ^^ S mU4S jn[        [        SSS9[        T R                  5      [	        U 4S j5      US9UU4S j5       nU" X#5      $ )Nc                 <   > SSK Jn  Ub  UR                  S5      mg g )Nr   )tracerzWaiting to retry RPC) chromadb.telemetry.opentelemetryr   
start_span)_r   
sleep_spans     r   before_sleepFRetryOnRpcErrorClientInterceptor._intercept_call.<locals>.before_sleep    s$    ? !#../EF
 "r   g?)jitterc                 >   > U R                  5       TR                  ;   $ r   )coder   )xr   s    r   <lambda>BRetryOnRpcErrorClientInterceptor._intercept_call.<locals>.<lambda>*   s    AFFH8S8S,Sr   )waitstopr   r    c                  >   > Tb  TR                  5         S mT" U 0 UD6$ r   )end)argskwargscontinuationr   s     r   wrappedARetryOnRpcErrorClientInterceptor._intercept_call.<locals>.wrapped'   s*     % !
000r   )r   r   r   r   r   )r   r.   client_call_detailsrequest_or_iteratorr    r/   r   s   ``    @r   _intercept_call0RetryOnRpcErrorClientInterceptor._intercept_call   sY    %)
	G 
(S9#D$5$56!"ST%	

	1

	1 *@@r   c                 &    U R                  XU5      $ r   r3   r   r.   r1   requests       r   intercept_unary_unary6RetryOnRpcErrorClientInterceptor.intercept_unary_unary6       ##LwOOr   c                 &    U R                  XU5      $ r   r6   r7   s       r   intercept_unary_stream7RetryOnRpcErrorClientInterceptor.intercept_unary_stream9   r;   r   c                 &    U R                  XU5      $ r   r6   r   r.   r1   request_iterators       r   intercept_stream_unary7RetryOnRpcErrorClientInterceptor.intercept_stream_unary<        ##LGWXXr   c                 &    U R                  XU5      $ r   r6   r@   s       r   intercept_stream_stream8RetryOnRpcErrorClientInterceptor.intercept_stream_streamA   rD   r   r   )__name__
__module____qualname____firstlineno____doc__int__annotations__r   grpc
StatusCodesetUNAVAILABLEUNKNOWNr   r3   r9   r=   rB   rF   __static_attributes__ r   r   r   r      s     00 7:__(($//*A*AB8
== !$DOO 4= 
=A2PPY
Yr   r   )typingr   r   rO   tenacityr   r   r   r   opentelemetry.tracer	   UnaryUnaryClientInterceptorUnaryStreamClientInterceptorr   rU   r   r   <module>r[      s1       X X $=Y$$d&G&G=Yr   