
    lht                         d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z	 e	rd dlm
Z
 d dlmZ d Z G d d	e      Zy)
    N)logger)Integration)TYPE_CHECKING)Any)Optionalc                     d } |d| z          |d|z          |dt         j                  dk(  xr dxs dz         t        j                  j	                          y)	zThis is the default shutdown callback that is set on the options.
    It prints out a message to stderr that informs the user that some events
    are still pending and the process is waiting for them to flush out.
    c                 H    t         j                  j                  | dz          y )N
)sysstderrwrite)msgs    p/var/www/pru.catia.catastroantioquia-mas.com/tasa/lib/python3.12/site-packages/sentry_sdk/integrations/atexit.pyechozdefault_callback.<locals>.echo   s    

t$    z.Sentry is attempting to send %i pending eventszWaiting up to %s secondszPress Ctrl-%s to quitntBreakCN)osnamer   r   flush)pendingtimeoutr   s      r   default_callbackr      sU    % 		9G	CD	#g	-.	 BGGtO$?$F3	GHJJr   c                   (    e Zd ZdZddZed        Zy)AtexitIntegrationatexitNc                 "    |t         }|| _        y N)r   callback)selfr    s     r   __init__zAtexitIntegration.__init__#   s    'H r   c                  0    t         j                  d        } y )Nc                  ,   t        j                         } | j                  t              }|y t	        j
                  d       t	        j
                  d       t        j                         j                          | j                  |j                         y )Nzatexit: got shutdown signalzatexit: shutting down client)r    )

sentry_sdk
get_clientget_integrationr   r   debugget_isolation_scopeend_sessioncloser    )clientintegrations     r   	_shutdownz/AtexitIntegration.setup_once.<locals>._shutdown,   so      **,F 001BCK"LL67LL78**,88:LL+"6"6L7r   )r   register)r.   s    r   
setup_oncezAtexitIntegration.setup_once)   s     
	8 
	8r   r   )__name__
__module____qualname__
identifierr"   staticmethodr0    r   r   r   r       s     J! 8 8r   r   )r   r   r   r%   sentry_sdk.utilsr   sentry_sdk.integrationsr   typingr   r   r   r   r   r6   r   r   <module>r:      s4    	 
   # /  "8 8r   