Viewing File: /opt/alt/python38/lib/python3.8/site-packages/sentry_sdk/integrations/__pycache__/rq.cpython-38.pyc
U
\ @ sx d dl mZ d dlZd dlmZ d dlmZ d dlmZm Z d dl
mZ d dlm
Z
G dd d eZd
d Zdd
ZdS ) )absolute_importN)Hub)Integration)capture_internal_exceptionsevent_from_exception)JobTimeoutException)Workerc @ s e Zd ZdZedd ZdS )
RqIntegrationrqc s4 t jfdd} | t _t j fdd}|t _d S )Nc s t j}|t}|d kr* | |f||S | 4}| |tt | | |f||}W 5 Q R X | j
r||j |S N)
r currentget_integrationr Z
push_scopeZclear_breadcrumbsZadd_event_processor_make_event_processorweakrefrefZis_horseclientflush)selfjobargskwargshubZintegrationZscoperv)old_perform_job /rq.pysentry_patched_perform_job s
z<RqIntegration.setup_once.<locals>.sentry_patched_perform_jobc s t | | |f||S r )_capture_exception)r r exc_infor )old_handle_exceptionr r sentry_patched_handle_exception9 s zARqIntegration.setup_once.<locals>.sentry_patched_handle_exception)r Zperform_jobZhandle_exception)r r r )r r r
setup_once s zRqIntegration.setup_onceN)__name__
__module____qualname__Z
identifierstaticmethodr! r r r r r s r c s fdd}|S )Nc s }|d k rft |j| d<