From ad5b4a81c3dc79c74b5815712c15f6ff5b19c78b Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 29 Feb 2024 09:48:41 +0300 Subject: [PATCH] get-author-debug --- resolvers/author.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resolvers/author.py b/resolvers/author.py index 5c7837d8..cf97c5f4 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -48,13 +48,16 @@ async def get_author(_, _info, slug='', author_id=None): if author_id: cache = await redis.execute('GET', f'id:{author_id}:author') + logger.debug(f'result from cache: {cache}') q = select(Author).where(Author.id == author_id) author_dict = json.loads(cache) if cache else get_with_stat(q)[0].dict() + logger.debug(f'author to be stored: {author_dict}') if author: await update_author_cache(author_dict) return author_dict - except Exception: + except Exception as exc: import traceback + logger.error(exc) exc = traceback.format_exc() logger.error(exc) return