precache-fix2

This commit is contained in:
Untone 2024-08-07 11:40:32 +03:00
parent c5a5e449d4
commit c1675cdf32

2
cache/precache.py vendored
View File

@ -83,7 +83,7 @@ async def precache_data():
# topics
topics = get_with_stat(select(Topic))
for topic in topics:
topic_dict = topic.dict() if not isinstance(topic, dict) else topic
topic_dict = topic.dict() if hasattr(topic, 'dict') else topic
await cache_topic(topic_dict)
await asyncio.gather(
precache_topics_followers(topic["id"], session), precache_topics_authors(topic_dict["id"], session)