
    Dj                     r    d dl Z d dl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y)
    N)
ContextVar)Integrationadd_global_event_processor)TYPE_CHECKING)Optional)EventHintc                   &    e Zd ZdZd Zed        Zy)DedupeIntegrationdedupec                 $    t        d      | _        y )Nz	last-seen)r   
_last_seen)selfs    bC:\Crop_Prediction\Backend\crop-ai-system\venv\Lib\site-packages\sentry_sdk/integrations/dedupe.py__init__zDedupeIntegration.__init__   s    $[1    c                      t         d        } y )Nc                    || S t        j                         j                  t              }|| S |j	                  dd       }|| S |d   }|j
                  j	                  d       |u ry |j
                  j                  |       | S )Nexc_info   )
sentry_sdk
get_clientget_integrationr   getr   set)eventhintintegrationr   excs        r   	processorz/DedupeIntegration.setup_once.<locals>.processor   s     |$//1AABSTK"xx
D1H1+C%%))$/36""&&s+Lr   r   )r!   s    r   
setup_oncezDedupeIntegration.setup_once   s     
$	 
$	r   N)__name__
__module____qualname__
identifierr   staticmethodr"    r   r   r   r      s     J2  r   r   )r   sentry_sdk.utilsr   sentry_sdk.integrationsr   sentry_sdk.scoper   typingr   r   sentry_sdk._typesr	   r
   r   r(   r   r   <module>r.      s)     ' / 7  - r   