관리-도구
편집 파일: 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 e�Zd d� Zdd � ZdS )� )�absolute_importN)�Hub)�Integration)�capture_internal_exceptions�event_from_exception)�JobTimeoutException)�Workerc @ s e Zd ZdZedd� �ZdS )� RqIntegration�rqc s4 t j��fdd�} | 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 �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_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__� identifier�staticmethodr! r r r r r s r c s � fdd�}|S )Nc s� � � }|d k rft � � |j| d<