update-redis-api
Some checks failed
Deploy to core / deploy (push) Failing after 1m27s

This commit is contained in:
2024-02-21 16:06:24 +03:00
parent 33330fb052
commit 63f5a708b7
7 changed files with 147 additions and 83 deletions

View File

@@ -131,13 +131,13 @@ def query_follows(user_id: str):
async def get_follows_by_user_id(user_id: str):
if user_id:
redis_key = f"user:{user_id}:follows"
res = await redis.execute("HGET", redis_key)
res = await redis.hget(redis_key)
if res:
return res
logger.debug(f"getting follows for {user_id}")
follows = query_follows(user_id)
await redis.execute("HSET", redis_key, **follows)
await redis.hset(redis_key, **follows)
return follows