From 541ba7e601e1000b07c029f3b8c61d3edcaf9505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=90=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Fri, 13 Mar 2026 17:09:02 +0300 Subject: [PATCH 1/2] fix redis --- core/db_adapter/aioredis_adapter.py | 6 +++--- core/db_adapter/aioredis_sentinel_adapter.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/db_adapter/aioredis_adapter.py b/core/db_adapter/aioredis_adapter.py index 20b4a2fb..5f983286 100644 --- a/core/db_adapter/aioredis_adapter.py +++ b/core/db_adapter/aioredis_adapter.py @@ -11,7 +11,7 @@ class AIORedisAdapter(AsyncDBAdapter): def __init__(self, config=None): super().__init__(config) - self.aioredis = importlib.import_module("redis", "asyncio") + self.aioredis = importlib.import_module("redis.asyncio") redis_type = self.aioredis.Redis self._redis: Optional[redis_type] = None @@ -36,8 +36,8 @@ async def path_exists(self, path): return await self._async_run(self._path_exists, path) async def connect(self): - print("Here is the content of REDIS_CONFIG:", self.config) - print("Connecting to a single redis server") + log(f"Here is the content of REDIS_CONFIG", params={"config": self.config}, level="DEBUG") + log("Connecting to a single redis server") config = copy.deepcopy(self.config) redis_url = config.pop("redis", None) if not isinstance(redis_url, str): diff --git a/core/db_adapter/aioredis_sentinel_adapter.py b/core/db_adapter/aioredis_sentinel_adapter.py index 27dad0bd..c1adfa8b 100644 --- a/core/db_adapter/aioredis_sentinel_adapter.py +++ b/core/db_adapter/aioredis_sentinel_adapter.py @@ -11,7 +11,7 @@ class AIORedisSentinelAdapter(AsyncDBAdapter): def __init__(self, config=None): super().__init__(config) - self.aioredis = importlib.import_module("redis", "asyncio") + self.aioredis = importlib.import_module("redis.asyncio") sentinel_type = self.aioredis.sentinel.Sentinel self._sentinel: typing.Optional[sentinel_type] = None self.service_name = None @@ -38,9 +38,8 @@ async def path_exists(self, path): return await self._async_run(self._path_exists, path) async def connect(self): - config = copy.deepcopy(self.config) - print("Here is the content of REDIS_CONFIG:", config) + log(f"Here is the content of REDIS_CONFIG", params={"config": config}, level="DEBUG") if not isinstance(config, dict): raise ValueError("REDIS_CONFIG should be a mapping") sentinels = config.pop("sentinels", None) From cc5a7dc36d546d8467a02fdacfbef56ed721c580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=90=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Thu, 26 Mar 2026 16:15:27 +0300 Subject: [PATCH 2/2] fix redis --- README.md | 1 + core/db_adapter/aioredis_adapter.py | 2 +- core/db_adapter/aioredis_sentinel_adapter.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 635861b1..42811b55 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ ____ ```shell python -m unittest discover -s tests -v +poetry run task lint ``` # Обратная связь diff --git a/core/db_adapter/aioredis_adapter.py b/core/db_adapter/aioredis_adapter.py index 5f983286..c1c476ef 100644 --- a/core/db_adapter/aioredis_adapter.py +++ b/core/db_adapter/aioredis_adapter.py @@ -36,7 +36,7 @@ async def path_exists(self, path): return await self._async_run(self._path_exists, path) async def connect(self): - log(f"Here is the content of REDIS_CONFIG", params={"config": self.config}, level="DEBUG") + log("Here is the content of REDIS_CONFIG", params={"config": self.config}, level="DEBUG") log("Connecting to a single redis server") config = copy.deepcopy(self.config) redis_url = config.pop("redis", None) diff --git a/core/db_adapter/aioredis_sentinel_adapter.py b/core/db_adapter/aioredis_sentinel_adapter.py index c1adfa8b..c1e1ddeb 100644 --- a/core/db_adapter/aioredis_sentinel_adapter.py +++ b/core/db_adapter/aioredis_sentinel_adapter.py @@ -39,7 +39,7 @@ async def path_exists(self, path): async def connect(self): config = copy.deepcopy(self.config) - log(f"Here is the content of REDIS_CONFIG", params={"config": config}, level="DEBUG") + log("Here is the content of REDIS_CONFIG", params={"config": config}, level="DEBUG") if not isinstance(config, dict): raise ValueError("REDIS_CONFIG should be a mapping") sentinels = config.pop("sentinels", None)