ruff format
This commit is contained in:
parent
fe1b02d937
commit
7149f8c45b
3 changed files with 27 additions and 21 deletions
|
|
@ -67,7 +67,9 @@ class RedisAdapter(CacheDBInterface):
|
||||||
try:
|
try:
|
||||||
self.sync_redis.ping()
|
self.sync_redis.ping()
|
||||||
except (redis.ConnectionError, redis.TimeoutError) as e:
|
except (redis.ConnectionError, redis.TimeoutError) as e:
|
||||||
raise CacheConnectionError(f"Cannot connect to Redis at {self.host}:{self.port}: {str(e)}") from e
|
raise CacheConnectionError(
|
||||||
|
f"Cannot connect to Redis at {self.host}:{self.port}: {str(e)}"
|
||||||
|
) from e
|
||||||
|
|
||||||
def acquire_lock(self):
|
def acquire_lock(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,9 @@ async def save_to_session_cache(
|
||||||
answer=answer,
|
answer=answer,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f"Successfully saved Q&A to session cache: user_id={user_id}, session_id={session_id}")
|
logger.info(
|
||||||
|
f"Successfully saved Q&A to session cache: user_id={user_id}, session_id={session_id}"
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
except CacheConnectionError as e:
|
except CacheConnectionError as e:
|
||||||
|
|
@ -67,5 +69,7 @@ async def save_to_session_cache(
|
||||||
return False
|
return False
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Unexpected error saving to session cache: {type(e).__name__}: {str(e)}. Continuing without caching.")
|
logger.error(
|
||||||
|
f"Unexpected error saving to session cache: {type(e).__name__}: {str(e)}. Continuing without caching."
|
||||||
|
)
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue