From 1f012ae5c9a3e34a1eeae244662f85e9e61a5b6e Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 28 Mar 2024 19:39:10 +0300 Subject: [PATCH] revalidate-stat --- resolvers/author.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resolvers/author.py b/resolvers/author.py index 9e964ea6..7f228195 100644 --- a/resolvers/author.py +++ b/resolvers/author.py @@ -70,7 +70,10 @@ async def get_author(_, _info, slug='', author_id=None): if cache and isinstance(cache, str): author_dict = json.loads(cache) logger.debug(f'got cached author {cache_key} -> {author_dict}') - else: + if not author_dict.get('stat'): + cache = '' + logger.warn(f'author {author_id} stat updating') + if not cache: [author] = await get_authors_with_stat_cached(author_query) if not author or not author.stat: [author] = get_with_stat(author_query)