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 20b4a2fb..c1c476ef 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("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..c1e1ddeb 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("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)