fmt
All checks were successful
Deploy on push / deploy (push) Successful in 24s

This commit is contained in:
2024-05-07 00:06:31 +03:00
parent e61db5d6e5
commit e0a5c654d8
9 changed files with 33 additions and 40 deletions

View File

@@ -1,9 +1,9 @@
import json
from orm.topic import TopicFollower
from services.db import local_session
from services.encoders import CustomJSONEncoder
from services.rediscache import redis
from services.db import local_session
DEFAULT_FOLLOWS = {
"topics": [],
@@ -64,10 +64,9 @@ 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", json.dumps(
followed_author_followers,
cls=CustomJSONEncoder
)
"SET",
f"author:{author_id}:followers",
json.dumps(followed_author_followers, cls=CustomJSONEncoder),
)
@@ -138,7 +137,6 @@ async def cache_follow_author_change(follower: dict, author: dict, is_insert=Tru
return followers
async def cache_topic(topic_dict: dict):
# update stat all field for followers' caches in <topics> list
followers = (