o
    io                     @   sx   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
r2d dl	mZ d dlmZmZ G dd	 d	eZdS )
    N)
ContextVarlogger)Integrationadd_global_event_processor)TYPE_CHECKING)Optional)EventHintc                   @   s6   e Zd ZdZd
ddZed
ddZed
dd	ZdS )DedupeIntegrationdedupereturnNc                 C   s   t d| _d S )Nz	last-seen)r   
_last_seen)self r   [/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/sentry_sdk/integrations/dedupe.py__init__   s   zDedupeIntegration.__init__c                  C   s   t d	dd} d S )
Neventr	   hintOptional[Hint]r   Optional[Event]c                 S   s   |d u r| S t  t}|d u r| S |dd }|d u r| S |jd }|d ur4t|tjr2| n|}|d }||u rDt	
d| d S z|jt| W | S  ty`   |j| Y | S w )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excr   r   r   	processor   s.   z/DedupeIntegration.setup_once.<locals>.processor)r   r	   r   r   r   r   r   )r&   r   r   r   
setup_once   s   zDedupeIntegration.setup_oncec                  C   s*   t  t} | d u rd S | jd  d S )N)r   r   r   r   r   r!   )r#   r   r   r   reset_last_seen9   s   z!DedupeIntegration.reset_last_seen)r   N)__name__
__module____qualname__
identifierr   staticmethodr'   r(   r   r   r   r   r      s    
"r   )r   r   sentry_sdk.utilsr   r   sentry_sdk.integrationsr   sentry_sdk.scoper   typingr   r   sentry_sdk._typesr	   r
   r   r   r   r   r   <module>   s    