following-cache-anyway-found
All checks were successful
Deploy on push / deploy (push) Successful in 27s

This commit is contained in:
Untone 2024-05-05 20:17:07 +03:00
parent 3ab42ecb72
commit ac5674d18f
4 changed files with 9 additions and 8 deletions

View File

@ -61,7 +61,7 @@ async def follow(_, info, what, slug):
if isinstance(author_dict, dict): if isinstance(author_dict, dict):
author_id = author_dict.get("id") author_id = author_dict.get("id")
if author_id: if author_id:
follows_ids = [a.get('id') for a in follows] follows_ids = [a.get("id") for a in follows]
if author_id not in follows_ids: if author_id not in follows_ids:
await cache_author(follower_dict) await cache_author(follower_dict)
await notify_follower(follower_dict, author_id, "follow") await notify_follower(follower_dict, author_id, "follow")

View File

@ -149,7 +149,8 @@ async def cache_topic(topic_dict: dict):
# topic not found in the list, so add the new topic with the updated stat field # topic not found in the list, so add the new topic with the updated stat field
follower_follows_topics.append(topic_dict) follower_follows_topics.append(topic_dict)
await redis.execute('SET', await redis.execute(
"SET",
"SET", "SET",
f"author:{follower_id}:follows-topics", f"author:{follower_id}:follows-topics",
json.dumps(follower_follows_topics), json.dumps(follower_follows_topics),