redis-multi-exec-fix-2

This commit is contained in:
Untone 2023-10-13 11:36:44 +03:00
parent dbf3d1c745
commit 25e05381cb
2 changed files with 3 additions and 4 deletions

View File

@ -53,7 +53,7 @@ async def create_chat(_, info, title="", members=None):
members.append(int(author_id))
await redis.execute('MULTI')
# NOTE: private chats has no title
# reuse private chat created before if exists
if len(members) == 2 and title == "":

View File

@ -11,6 +11,8 @@ class RedisCache:
async def connect(self):
self._redis = aredis.StrictRedis.from_url(self._uri, decode_responses=True)
response = await self._redis.execute('PING')
print(f"[redis] PING response: {response}")
async def disconnect(self):
self._redis.connection_pool.disconnect()
@ -52,9 +54,6 @@ class RedisCache:
print(f"[redis] MGET {key} {keys}")
return await self._redis.mget(key, *keys)
async def pipeline(self):
print(f"[redis] pipeline")
return await self._redis.pipeline()
redis = RedisCache()