From 9212fbe6b5eb6680eccd2fc2ece520d9edad0224 Mon Sep 17 00:00:00 2001 From: Untone Date: Thu, 30 May 2024 20:55:47 +0300 Subject: [PATCH] followers-cache-fix --- services/cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/cache.py b/services/cache.py index 9bd21cf5..b899277a 100644 --- a/services/cache.py +++ b/services/cache.py @@ -132,7 +132,9 @@ async def get_cached_topic_followers(topic_id: int): async def get_cached_author_followers(author_id: int): # follower profile cached_author = await redis.execute("GET", f"author:id:{author_id}") - author = json.loads(cache_author) + author = None + if cache_author: + author = json.loads(cache_author) if not author: return []