From 5a3bf357a88ce57163fd37ea1963360ed602edaf Mon Sep 17 00:00:00 2001 From: Korzhavin Ivan Date: Sat, 26 Apr 2025 12:13:14 +0200 Subject: [PATCH] fix: update Redis SSL environment variable handling --- backend/services/redis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/services/redis.py b/backend/services/redis.py index e07127e7..5a49f7aa 100644 --- a/backend/services/redis.py +++ b/backend/services/redis.py @@ -25,7 +25,9 @@ def initialize(): redis_host = os.getenv('REDIS_HOST', 'redis') redis_port = int(os.getenv('REDIS_PORT', 6379)) redis_password = os.getenv('REDIS_PASSWORD', '') - redis_ssl = os.getenv('REDIS_SSL', False) + # Convert string 'True'/'False' to boolean + redis_ssl_str = os.getenv('REDIS_SSL', 'False') + redis_ssl = redis_ssl_str.lower() == 'true' logger.info(f"Initializing Redis connection to {redis_host}:{redis_port}") @@ -146,4 +148,4 @@ async def expire(key: str, time: int): async def keys(pattern: str) -> List[str]: """Get keys matching a pattern.""" redis_client = await get_client() - return await redis_client.keys(pattern) \ No newline at end of file + return await redis_client.keys(pattern) \ No newline at end of file