This commit is contained in:
parent
69a5dfcc45
commit
c5a5e449d4
6
cache/precache.py
vendored
6
cache/precache.py
vendored
|
@ -83,10 +83,10 @@ async def precache_data():
|
||||||
# topics
|
# topics
|
||||||
topics = get_with_stat(select(Topic))
|
topics = get_with_stat(select(Topic))
|
||||||
for topic in topics:
|
for topic in topics:
|
||||||
topic_profile = topic.dict() if not isinstance(topic, dict) else topic
|
topic_dict = topic.dict() if not isinstance(topic, dict) else topic
|
||||||
await cache_topic(topic_profile)
|
await cache_topic(topic_dict)
|
||||||
await asyncio.gather(
|
await asyncio.gather(
|
||||||
precache_topics_followers(topic["id"], session), precache_topics_authors(topic["id"], session)
|
precache_topics_followers(topic["id"], session), precache_topics_authors(topic_dict["id"], session)
|
||||||
)
|
)
|
||||||
logger.info(f"{len(topics)} topics and their followings precached")
|
logger.info(f"{len(topics)} topics and their followings precached")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user