From 944af4e96caad63ffeece9a5f7aaf3f1b30f6248 Mon Sep 17 00:00:00 2001 From: knst-kotov Date: Fri, 17 Dec 2021 11:37:55 +0300 Subject: [PATCH] clear topic stats before load --- orm/shout.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/orm/shout.py b/orm/shout.py index 58d35edf..69dde280 100644 --- a/orm/shout.py +++ b/orm/shout.py @@ -171,6 +171,12 @@ class TopicStat: @staticmethod async def load_stat(session): self = TopicStat + + self.shouts_by_topic = {} + self.authors_by_topic = {} + self.subs_by_topic = {} + self.views_by_topic = {} + shout_topics = session.query(ShoutTopic) for shout_topic in shout_topics: topic = shout_topic.topic