From 658c8c7702e39013e623278aa20acf497f844ada Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 6 May 2024 20:30:49 +0300 Subject: [PATCH] followers-cache-fix --- services/cache.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/cache.py b/services/cache.py index 5ef17221..50a8d1bc 100644 --- a/services/cache.py +++ b/services/cache.py @@ -64,7 +64,10 @@ async def cache_author(author: dict): # author not found in the list, so add the new author with the updated stat field followed_author_followers.append(author) await redis.execute( - "SET", f"author:{author_id}:followers", followed_author_followers + "SET", f"author:{author_id}:followers", json.dumps( + followed_author_followers, + cls=CustomJSONEncoder + ) ) @@ -157,7 +160,7 @@ async def cache_topic(topic_dict: dict): "SET", "SET", f"author:{follower_id}:follows-topics", - json.dumps(follower_follows_topics), + json.dumps(follower_follows_topics, cls=CustomJSONEncoder), ) # update topic's stat