From 23547546cb28291ec835bdc76dae577484aad306 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 12 Mar 2024 16:46:18 +0300 Subject: [PATCH] cached-authors-fix --- resolvers/author.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resolvers/author.py b/resolvers/author.py index 4b9b01ba..5e6b8c6d 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -51,8 +51,9 @@ async def get_author(_, _info, slug='', author_id=None): author_id = author.id if author_id: - cache = await redis.execute('GET', f'author:{author_id}') - logger.debug(f'result from cache: {cache}') + cache_key = f'author:{author_id}' + cache = await redis.execute('GET', cache_key) + logger.debug(f'result from {cache_key}: {cache}') q = select(Author).where(Author.id == author_id) author_dict = None if cache: @@ -146,7 +147,7 @@ async def load_authors_by(_, _info, by, limit, offset): return authors - return await _load_authors_by() + return await _load_authors_by(_, _info, by, limit, offset)