o
    BD©i4  ã                   @   sˆ   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 )é    )ÚIntegrationÚDidNotEnable)Ú_DEFAULT_MAX_DATA_SIZE)Ú	_patch_rb)Ú_patch_redis)Ú_patch_redis_cluster)Ú_patch_rediscluster)Úlogger)ÚTYPE_CHECKING)ÚOptionalc                   @   s*   e Zd ZdZedfdd„Zedd„ ƒZdS )ÚRedisIntegrationÚredisNc                 C   s"   || _ |d ur|| _d S g | _d S )N)Úmax_data_sizeÚcache_prefixes)Úselfr   r   © r   ú_/var/www/Datamplify/venv/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)Ú__name__Ú
__module__Ú__qualname__Ú
identifierr   r   Ústaticmethodr   r   r   r   r   r      s
    r   N)Ú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    