This commit is contained in:
parent
98010ed1bc
commit
d20647c825
|
@ -115,9 +115,9 @@ async def get_cached_author_follows_authors(author_id: int):
|
||||||
select(Author.id)
|
select(Author.id)
|
||||||
.select_from(join(Author, AuthorFollower, Author.id == AuthorFollower.author))
|
.select_from(join(Author, AuthorFollower, Author.id == AuthorFollower.author))
|
||||||
.where(AuthorFollower.follower == author_id)
|
.where(AuthorFollower.follower == author_id)
|
||||||
.all()
|
|
||||||
)
|
)
|
||||||
authors = local_session().execute(authors_query)
|
with local_session() as session:
|
||||||
|
authors = session.execute(authors_query)
|
||||||
await redis.execute("SET", rkey, json.dumps([aid for aid in authors]))
|
await redis.execute("SET", rkey, json.dumps([aid for aid in authors]))
|
||||||
elif isinstance(cached, str):
|
elif isinstance(cached, str):
|
||||||
authors = json.loads(cached)
|
authors = json.loads(cached)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user