refactor: improve code readability by formatting arguments across multiple files
Test / test (push) Successful in 15s
Test / test (push) Successful in 15s
This commit is contained in:
+11
-3
@@ -46,7 +46,9 @@ class RedisCacheManager:
|
||||
if self._client is not None:
|
||||
return
|
||||
self._client = redis.from_url(
|
||||
settings.redis_url, encoding="utf-8", decode_responses=False,
|
||||
settings.redis_url,
|
||||
encoding="utf-8",
|
||||
decode_responses=False,
|
||||
)
|
||||
await self._refresh_availability()
|
||||
|
||||
@@ -63,7 +65,9 @@ class RedisCacheManager:
|
||||
async with self._lock:
|
||||
if self._client is None:
|
||||
self._client = redis.from_url(
|
||||
settings.redis_url, encoding="utf-8", decode_responses=False,
|
||||
settings.redis_url,
|
||||
encoding="utf-8",
|
||||
decode_responses=False,
|
||||
)
|
||||
await self._refresh_availability()
|
||||
|
||||
@@ -127,7 +131,11 @@ async def read_json(client: Redis, key: str) -> Any | None:
|
||||
|
||||
|
||||
async def write_json(
|
||||
client: Redis, key: str, value: Any, ttl_seconds: int, backoff_ms: int,
|
||||
client: Redis,
|
||||
key: str,
|
||||
value: Any,
|
||||
ttl_seconds: int,
|
||||
backoff_ms: int,
|
||||
) -> None:
|
||||
"""Serialize data to JSON and store it with TTL using retry/backoff."""
|
||||
payload = json.dumps(value, separators=(",", ":"), ensure_ascii=True).encode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user