Viewing File: /opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/__pycache__/rq.cpython-38.pyc

U

��\��@sxddlmZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
Gdd	�d	e�Zd
d�Zdd
�ZdS)�)�absolute_importN)�Hub)�Integration)�capture_internal_exceptions�event_from_exception)�JobTimeoutException)�Workerc@seZdZdZedd��ZdS)�
RqIntegration�rqcs4tj��fdd�}|t_tj��fdd�}|t_dS)Nc	s�tj}|�t�}|dkr*�||f|�|�S|���4}|��|�tt�	|����||f|�|�}W5QRX|j
r||j��|S�N)
r�current�get_integrationr	Z
push_scopeZclear_breadcrumbsZadd_event_processor�_make_event_processor�weakref�refZis_horse�client�flush)�self�job�args�kwargs�hubZintegrationZscope�rv)�old_perform_job��K/opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/rq.py�sentry_patched_perform_job s


z<RqIntegration.setup_once.<locals>.sentry_patched_perform_jobcst|��||f|�|�Sr)�_capture_exception)rr�exc_infor)�old_handle_exceptionrr�sentry_patched_handle_exception9szARqIntegration.setup_once.<locals>.sentry_patched_handle_exception)rZperform_jobZhandle_exception)rr r)rrr�
setup_onceszRqIntegration.setup_onceN)�__name__�
__module__�__qualname__�
identifier�staticmethodr!rrrrr	sr	cs�fdd�}|S)Nc	s���}|dk	rft��|j|d<W5QRXt��0|�di�}|j|j|j|j|jd�|d<W5QRXd|kr�t��(t|ddt�r�dd|jg|d	<W5QRX|S)
NZtransaction�extra)Zjob_id�funcrr�descriptionzrq-jobrrr
rZfingerprint)	r�	func_name�
setdefault�idrrr)�
issubclassr)�event�hintrr'��weak_jobrr�event_processorBs"�z._make_event_processor.<locals>.event_processorr)r1r2rr0rr@srcKsFtj}|�t�dkrdSt||jjddd�d�\}}|j||d�dS)Nr
F)�typeZhandled)Zclient_optionsZ	mechanism)r/)rrr
r	rr�optionsZ
capture_event)rrrr.r/rrrr]s�
r)�
__future__rrZsentry_sdk.hubrZsentry_sdk.integrationsrZsentry_sdk.utilsrrZrq.timeoutsrZ	rq.workerrZAny�Dict�CallableZJobZQueueZExcInfor	rrrrrr�<module>s
)
Back to Directory File Manager