This commit is contained in:
@@ -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 = (
|
||||
|
Reference in New Issue
Block a user