This commit is contained in:
2024-04-17 18:32:23 +03:00
parent 937b154c6b
commit c25d7e3ab6
39 changed files with 986 additions and 926 deletions

View File

@@ -5,7 +5,7 @@ import redis.asyncio as aredis
from settings import REDIS_URL
# Set redis logging level to suppress DEBUG messages
logger = logging.getLogger('redis')
logger = logging.getLogger("redis")
logger.setLevel(logging.WARNING)
@@ -25,11 +25,11 @@ class RedisCache:
async def execute(self, command, *args, **kwargs):
if self._client:
try:
logger.debug(f'{command} {args} {kwargs}')
logger.debug(f"{command} {args} {kwargs}")
for arg in args:
if isinstance(arg, dict):
if arg.get('_sa_instance_state'):
del arg['_sa_instance_state']
if arg.get("_sa_instance_state"):
del arg["_sa_instance_state"]
r = await self._client.execute_command(command, *args, **kwargs)
logger.debug(type(r))
logger.debug(r)
@@ -60,4 +60,4 @@ class RedisCache:
redis = RedisCache()
__all__ = ['redis']
__all__ = ["redis"]