Improve AI logic
This commit is contained in:
@@ -46,14 +46,28 @@ class RedisConnectionManager:
|
||||
"""
|
||||
try:
|
||||
# Create connection pool
|
||||
# Handle SSL parameters for self-signed certificates
|
||||
connection_kwargs = {
|
||||
'db': db,
|
||||
'max_connections': max_connections,
|
||||
'decode_responses': decode_responses,
|
||||
'retry_on_timeout': retry_on_timeout,
|
||||
'socket_keepalive': socket_keepalive,
|
||||
'health_check_interval': health_check_interval
|
||||
}
|
||||
|
||||
# If using SSL/TLS, add SSL parameters to handle self-signed certificates
|
||||
if redis_url.startswith('rediss://'):
|
||||
connection_kwargs.update({
|
||||
'ssl_cert_reqs': None, # Disable certificate verification
|
||||
'ssl_ca_certs': None, # Don't require CA certificates
|
||||
'ssl_certfile': None, # Don't require client cert
|
||||
'ssl_keyfile': None # Don't require client key
|
||||
})
|
||||
|
||||
self._pool = redis.ConnectionPool.from_url(
|
||||
redis_url,
|
||||
db=db,
|
||||
max_connections=max_connections,
|
||||
decode_responses=decode_responses,
|
||||
retry_on_timeout=retry_on_timeout,
|
||||
socket_keepalive=socket_keepalive,
|
||||
health_check_interval=health_check_interval
|
||||
**connection_kwargs
|
||||
)
|
||||
|
||||
# Create Redis client with pool
|
||||
|
||||
Reference in New Issue
Block a user