Fix redis ssl issues
This commit is contained in:
@@ -49,11 +49,17 @@ class UsageForecastResponse(BaseModel):
|
||||
|
||||
async def get_redis_client() -> redis.Redis:
|
||||
"""Get Redis client for usage tracking"""
|
||||
return redis.from_url(
|
||||
settings.REDIS_URL,
|
||||
encoding="utf-8",
|
||||
decode_responses=True
|
||||
)
|
||||
import ssl
|
||||
|
||||
# Handle SSL/TLS for self-signed certificates
|
||||
connection_kwargs = {
|
||||
"encoding": "utf-8",
|
||||
"decode_responses": True
|
||||
}
|
||||
if settings.REDIS_URL and settings.REDIS_URL.startswith("rediss://"):
|
||||
connection_kwargs["ssl_cert_reqs"] = ssl.CERT_NONE
|
||||
|
||||
return redis.from_url(settings.REDIS_URL, **connection_kwargs)
|
||||
|
||||
|
||||
async def get_usage_history(
|
||||
|
||||
Reference in New Issue
Block a user