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

This commit is contained in:
2024-02-26 03:49:56 +03:00
parent 5478ff45e7
commit a00c68068f
3 changed files with 71 additions and 43 deletions

View File

@@ -47,7 +47,7 @@ async def get_author(_, _info, slug='', author_id=None):
[author] = session.execute(q)
author_id = cast(Author.id, Integer)
if author_id:
if bool(author_id):
cache = await redis.execute('GET', f'id:{author_id}:author')
author = json.loads(cache) if cache else get_with_stat(select(Author).where(Author.id == author_id)).first()
if author: