관리-도구
편집 파일: caching.cpython-311.pyc
� �܋fl � � � d dl Z d dlmZ d dlmZ d dlmZ d dlm Z d dl mZmZ d dl mZ erd dlmZ d d lmZ d dgZd� Zd � Zd� Zd� ZdS )� N)� TYPE_CHECKING)�VERSION)�CacheHandler)�Hub)�OP�SPANDATA)� text_type)�Any)�Callable�get�get_manyc �� � d� | � � }|�,t |� � dk r|t |d � � z }n|�d|v r|t |d � � z }|S )Nz{} � r �key)�format�lenr )�method_name�args�kwargs�descriptions �w/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/sentry_sdk/integrations/django/caching.py�_get_span_descriptionr si � ��,�,�{�+�+�K���C��I�I��N�N��y��a��)�)�)��� � ������y����/�/�/���� c � � ����� ddl m� �fd��t � �� � �t j �� � �� ��fd�� � }t � �|� � d S )Nr ��DjangoIntegrationc � �� t j }|� �� � }|�|j s ||i |��S t |||� � }|� t j |�� � 5 } ||i |��} | r]|� t j d� � t t | � � � � } |� t j | � � n |� t j d� � | cd d d � � S # 1 swxY w Y d S )N)�opr TF)r �current�get_integration�cache_spansr � start_spanr �CACHE_GET_ITEM�set_datar � CACHE_HITr r �CACHE_ITEM_SIZE)�cacher �original_methodr r �hub�integrationr �span�value�sizer s �r �_instrument_callz-_patch_cache_method.<locals>._instrument_call'