Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
perf: Enhance Redis reliability with fine-tuned timeout
Clémence Lesné25b2a5cff471
diff --git a/persistence/redis.py b/persistence/redis.pyindex 969280e..ca23b6b 100644--- a/persistence/redis.py+++ b/persistence/redis.py@@ -7,7 +7,7 @@ from persistence.icache import ICachefrom redis.asyncio import Redisfrom redis.asyncio.retry import Retryfrom redis.backoff import ExponentialBackoff-from redis.exceptions import BusyLoadingError, ConnectionError, TimeoutError, RedisError+from redis.exceptions import BusyLoadingError, ConnectionError, RedisErrorfrom typing import AsyncGenerator, Optional, Unionfrom uuid import uuid4import hashlib@@ -17,7 +17,7 @@ import hashlibRedisInstrumentor().instrument()_logger = build_logger(__name__)-_retry = Retry(ExponentialBackoff(), 3)+_retry = Retry(backoff=ExponentialBackoff(), retries=3)class RedisCache(ICache):@@ -97,9 +97,10 @@ class RedisCache(ICache):# Database locationdb=self._config.database,# Reliability- retry_on_error=[BusyLoadingError, ConnectionError, TimeoutError],+ retry_on_error=[BusyLoadingError, ConnectionError],+ retry_on_timeout=True,retry=_retry,- socket_connect_timeout=10,+ socket_timeout=10, # Copied to socket_connect_timeout# Azure deploymenthost=self._config.host,port=self._config.port,