Uname : Linux premium36.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Soft : LiteSpeed
Ip : 198.54.115.237
Port : 443
~
/
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
__pycache__
[ HOME ]
Exec
Submit
monitor.cpython-312.pyc
� w�/i7 � �l � d dl Z d dlZd dlmZmZ d dlZd dlmZ d dlm Z e rd dlm Z dZ G d� d� Zy) � N)�Thread�Lock)�logger)� TYPE_CHECKING)�Optional� c �P � e Zd ZdZdZdd�Zd� Zd� Zd� Zd� Z d� Z ed � � Zd � Z y) �Monitorz� Performs health checks in a separate thread once every interval seconds and updates the internal state. Other parts of the SDK only read this state and act accordingly. zsentry.monitorc � � || _ || _ d| _ d| _ d | _ t � | _ d | _ d| _ y )NTr ) � transport�interval�_healthy�_downsample_factor�_threadr �_thread_lock�_thread_for_pid�_running)�selfr r s �A/opt/hc_python/lib/python3.12/site-packages/sentry_sdk/monitor.py�__init__zMonitor.__init__ s? � �"��� �� ��� �"#������ �F���#����� � c � � � � j t j � k( r � j �y� j 5 � j t j � k( r� j � ddd� y� fd�}t � j |�� }d|_ |j � |� _ t j � � _ ddd� y# t $ r d� _ Y ddd� yw xY w# 1 sw Y yxY w)a- Check that the monitor has an active thread to run in, or create one if not. Note that this might fail (e.g. in Python 3.12 it's not possible to spawn new threads at interpreter shutdown). In that case self._running will be False after running this function. Nc � �� � j rIt j � j � � j r� j � � j r�Hy y �N)r �time�sleepr �run�r s �r r z(Monitor._ensure_running.<locals>._thread7 s3 �� ��m�m��J�J�t�}�}�-��}�}���� � �m�mr )�name�targetTF)r �os�getpidr r r r �daemon�start�RuntimeErrorr )r r �threads ` r �_ensure_runningzMonitor._ensure_running'