
    tnio                         d dl Z d dlZd dlmZm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mZ  G d d	e          ZdS )
    N)
ContextVarlogger)Integrationadd_global_event_processor)TYPE_CHECKING)Optional)EventHintc                   J    e Zd ZdZddZedd            Zedd            ZdS )DedupeIntegrationdedupereturnNc                 .    t          d          | _        d S )Nz	last-seen)r   
_last_seen)selfs    [/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/sentry_sdk/integrations/dedupe.py__init__zDedupeIntegration.__init__   s    $[11    c                  (    t           dd            } d S )	Neventr
   hintOptional[Hint]r   Optional[Event]c                    || S t          j                                        t                    }|| S |                    dd           }|| S |j                            d           }|&t          |t          j                  r
 |            n|}|d         }||u rt          j
        d|           d S 	 |j                            t          j        |                     n*# t          $ r |j                            |           Y nw xY w| S )Nexc_info   z3DedupeIntegration dropped duplicated error event %s)
sentry_sdk
get_clientget_integrationr   getr   
isinstanceweakrefrefr   infoset	TypeError)r   r   integrationr   	last_seenexcs         r   	processorz/DedupeIntegration.setup_once.<locals>.processor   s*   |$/11AABSTTK"xx
D11H#.22488I$ $.i#E#ETIIKKK9  1+CCQSVWWWt0&**7;s+;+;<<<< 0 0 0&**3/////0 Ls   4,C! !$DD)r   r
   r   r   r   r   r   )r+   s    r   
setup_oncezDedupeIntegration.setup_once   s+    	#	 	 	 
$	#	 	 	r   c                      t          j                                        t                    } | d S | j                            d            d S )N)r   r   r    r   r   r&   )r(   s    r   reset_last_seenz!DedupeIntegration.reset_last_seen9   sG     +--==>OPPF""4(((((r   )r   N)__name__
__module____qualname__
identifierr   staticmethodr,   r.    r   r   r   r      sn        J2 2 2 2       \ D ) ) ) \) ) )r   r   )r#   r   sentry_sdk.utilsr   r   sentry_sdk.integrationsr   sentry_sdk.scoper   typingr   r	   sentry_sdk._typesr
   r   r   r4   r   r   <module>r:      s         / / / / / / / / / / / / / / 7 7 7 7 7 7             .--------/) /) /) /) /) /) /) /) /) /)r   