cache-fix-10
All checks were successful
Deploy on push / deploy (push) Successful in 47s

This commit is contained in:
Untone 2024-05-30 20:49:37 +03:00
parent c9dcd6a9c9
commit 8dcd985c67

View File

@ -175,8 +175,9 @@ async def get_cached_follower_authors(author_id: int):
.where(AuthorFollower.follower == author_id) .where(AuthorFollower.follower == author_id)
) )
with local_session() as session: with local_session() as session:
[authors_ids] = session.execute(authors_query) result = session.execute(authors_query)
await redis.execute("SET", rkey, json.dumps([int(aid) for aid in authors_ids])) authors_ids = [a[0] for a in result]
await redis.execute("SET", rkey, json.dumps(authors_ids))
elif isinstance(cached, str): elif isinstance(cached, str):
authors_ids = json.loads(cached) authors_ids = json.loads(cached)
return await get_cached_authors_by_ids(authors_ids) return await get_cached_authors_by_ids(authors_ids)