관리-도구
편집 파일: caches.cpython-38.pyc
U �Mg� � @ s� d Z ddlmZmZ ddlmZmZ ddlmZ dZ dZ ddlmZ erpddl mZ dd lmZ dd lmZmZ dd� Zd d� Zdd� Zdd� ZdS )z+ Code used for the Caches module in Sentry � )�OP�SPANDATA)� _get_safe_key�_key_as_string)�capture_internal_exceptions)�getZmget)�set�setex)� TYPE_CHECKING)�RedisIntegration)�Span)�Any�Optionalc C s. d }| � � tkrtj}n| � � tkr*tj}|S )N)�lower�GET_COMMANDSr Z CACHE_GET�SET_COMMANDSZ CACHE_PUT)�name�op� r �Z/opt/hc_python/lib/python3.8/site-packages/sentry_sdk/integrations/redis/modules/caches.py�_get_op s r c C s� t | ||�}t|�}|�d�}d}|jD ](}|D ]} | �|�r0d} qHq0|r( qRq(d } | �� tkrj|d } t| �t| |||�||| �� || d�}|S )Nz, FT���)r �description�key� key_as_string� redis_command�is_cache_key�value) r r �splitZcache_prefixes� startswithr r r �_get_cache_span_description)r �args�kwargs�integrationr r Zkeys_as_stringr �prefixZkeer � propertiesr r r �_compile_cache_span_properties s8 ��r&