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	eZd
dZdd
ZdS))absolute_importN)Hub)Integration)capture_internal_exceptionsevent_from_exception)JobTimeoutException)Workerc@seZdZdZeddZdS)
RqIntegrationrqcs4tjfdd}|t_tjfdd}|t_dS)Nc	stj}|t}|dkr*||f||S|4}||tt	|||f||}W5QRX|j
r||j|SN)
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|||f||Sr)_capture_exception)rrexc_infor)old_handle_exceptionrrsentry_patched_handle_exception9szARqIntegration.setup_once.<locals>.sentry_patched_handle_exception)rZperform_jobZhandle_exception)rr r)rrr
setup_onceszRqIntegration.setup_onceN)__name__
__module____qualname__Z
identifierstaticmethodr!rrrrr	sr	csfdd}|S)Nc	s}|dk	rft|j|d<W5QRXt0|di}|j|j|j|j|jd|d<W5QRXd|krt(t|ddtrdd|jg|d	<W5QRX|S)
NZtransactionextra)Zjob_idfuncrrdescriptionzrq-jobrrr
rZfingerprint)	rZ	func_name
setdefaultidrrr(
issubclassr)eventhintrr&weak_jobrrevent_processorBs"z._make_event_processor.<locals>.event_processorr)r/r0rr.rr@srcKsFtj}|tdkrdSt||jjdddd\}}|j||ddS)Nr
F)typeZhandled)Zclient_optionsZ	mechanism)r-)rrr
r	rrZoptionsZ
capture_event)rrrr,r-rrrr]s
r)Z
__future__rrZsentry_sdk.hubrZsentry_sdk.integrationsrZsentry_sdk.utilsrrZrq.timeoutsrZ	rq.workerrZAnyZDictCallableZJobZQueueZExcInfor	rrrrrr<module>s
)
Back to Directory File Manager