cached-empty-fix

This commit is contained in:
Untone 2024-05-27 19:55:56 +03:00
parent 7b72963b24
commit 01d2d90df1

View File

@ -330,7 +330,7 @@ async def get_author_followers(_, _info, slug: str):
cached = await redis.execute("GET", f"author:{author_id}:followers")
if cached:
followers_cached = json.loads(cached)
if isinstance(followers_cached, list):
if isinstance(followers_cached, list) and len(followers_cached) > 0:
logger.debug(
f"@{slug} got {len(followers_cached)} followers cached"
)