Viewing File: /opt/alt/python35/lib/python3.5/site-packages/sentry_sdk/integrations/__pycache__/rq.cpython-35.pyc



\@sddlmZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
Gdd	d	eZd
dZdd
ZdS))absolute_importN)Hub)Integration)capture_internal_exceptionsevent_from_exception)JobTimeoutException)Workerc@s(eZdZdZeddZdS)
RqIntegrationrqcsLtjfdd}|t_tjfdd}|t_dS)Ncstj}|jt}|dkr7||||S|jB}|j|jttj	|||||}WdQRX|j
r|jj|S)N)
rcurrentget_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_jobcst|||||S)N)_capture_exception)rrexc_infor)old_handle_exceptionrrsentry_patched_handle_exception9s
zARqIntegration.setup_once.<locals>.sentry_patched_handle_exception)rZperform_jobZhandle_exception)rrr)rrr
setup_onces			zRqIntegration.setup_onceN)__name__
__module____qualname__Z
identifierstaticmethodr rrrrr	sr	csfdd}|S)Ncs}|dk	rt|j|d<WdQRXtN|jdi}d|jd|jd|jd|jd|ji|d<WdQRXd	|krt2t|d	d
trdd|jg|d
<WdQRX|S)NZtransactionextraZjob_idfuncrrdescriptionzrq-jobrrr
rZfingerprint)	r	func_name
setdefaultidrrr'
issubclassr)eventhintrr%)weak_jobrrevent_processorBs 	

				
z._make_event_processor.<locals>.event_processorr)r.r/r)r.rr
@sr
c	Ksitj}|jtdkr"dSt|d|jjdddddi\}}|j|d|dS)NZclient_optionsZ	mechanismtyper
ZhandledFr-)rrrr	rrZoptionsZ
capture_event)rrrr,r-rrrr]s	r)Z
__future__rrZsentry_sdk.hubrZsentry_sdk.integrationsrZsentry_sdk.utilsrrZrq.timeoutsrZ	rq.workerrr	r
rrrrr<module>s
)
Back to Directory File Manager