o
    ٰi~                     @   s   d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d d	lmZ er>d d
lmZ G dd deZdS )    N)IntegrationDidNotEnable)_DEFAULT_MAX_DATA_SIZE)	_patch_rb)_patch_redis)_patch_redis_cluster)_patch_rediscluster)logger)TYPE_CHECKING)Optionalc                   @   s8   e Zd ZdZedf					ddd	Zedd
dZdS )RedisIntegrationredisNmax_data_sizeOptional[int]cache_prefixesOptional[list[str]]returnc                 C   s8   || _ |d ur	|ng | _|d urtjdtdd d S d S )NzsThe `max_data_size` parameter of `RedisIntegration` is deprecated and will be removed in version 3.0 of sentry-sdk.   )
stacklevel)r   r   warningswarnDeprecationWarning)selfr   r    r   Z/home/ubuntu/.local/lib/python3.10/site-packages/sentry_sdk/integrations/redis/__init__.py__init__   s   
zRedisIntegration.__init__c                  C   sn   z
ddl m} m} W n ty   tdw t| | t  t  zt  W d S  t	y6   t
d Y d S w )Nr   StrictRedisclientzRedis client not installedz4Error occurred while patching `rediscluster` library)r   r   r   ImportErrorr   r   r   r   r   	Exceptionr	   	exceptionr   r   r   r   
setup_once$   s   
zRedisIntegration.setup_once)r   r   r   r   r   N)r   N)__name__
__module____qualname__
identifierr   r   staticmethodr"   r   r   r   r   r      s    
r   )r   sentry_sdk.integrationsr   r   $sentry_sdk.integrations.redis.constsr    sentry_sdk.integrations.redis.rbr   #sentry_sdk.integrations.redis.redisr   +sentry_sdk.integrations.redis.redis_clusterr   5sentry_sdk.integrations.redis.redis_py_cluster_legacyr   sentry_sdk.utilsr	   typingr
   r   r   r   r   r   r   <module>   s    