관리-도구
편집 파일: sessions.cpython-311.pyc
� �܋f � � � d dl Z d dlZd dlmZmZ d dlmZ d dlZd dlm Z d dl mZ d dlm Z d dlmZ e r*d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ dd�Zedd�� � ZdZdZd� Z G d� de� � ZdS )� N)�Thread�Lock)�contextmanager)�Envelope)�Session)� TYPE_CHECKING)�format_timestamp)�Any)�Callable)�Dict)� Generator)�List)�Optional)�Unionc � � | �t j j } | j j }|�+| j r| j j ni }|� dd� � }|S )z<Utility function to find out if session tracking is enabled.N�auto_session_trackingF)� sentry_sdk�Hub�current�scope�_force_auto_session_tracking�client�options�get)�hub�should_track�client_optionss �J/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/sessions.py� is_auto_session_tracking_enabledr sU � � �{��n�$���9�9�L���/2�z�A���+�+�r��%�)�)�*A�5�I�I���� �applicationc # �� K � | �t j j } t | � � }|r| � |�� � dV � |r| � � � dS dS # |r| � � � w w xY w)z8Starts and stops a session automatically around a block.N)�session_mode)r r r r � start_session�end_session)r r# r s r r r % s� � � � � �{��n�$��3�C�8�8�L�� 5����|��4�4�4�� ����� ��O�O������ � ��<� ��O�O����� ���s �A �A5)�exited�abnormal�crashed�d c �d � t |� � t | � � � � � d�S )N)�attrs� aggregates)�dict�list�values)�aggregate_statesr+ s r �make_aggregate_enveloper1 9 s+ � ��%�[�[��5E�5L�5L�5N�5N�0O�0O�P�P�Pr c �<