all authors and some logs

This commit is contained in:
2022-11-17 09:25:26 +03:00
parent 43cf5ea361
commit d62342880b
4 changed files with 17 additions and 13 deletions

View File

@@ -168,22 +168,25 @@ class ReactedStorage:
self = ReactedStorage
all_reactions = session.query(Reaction).all()
self.modified_shouts = list(set([r.shout for r in all_reactions]))
print("[stat.reacted] %d shouts with reactions loaded" % len(self.modified_shouts))
print("[stat.reacted] %d shouts with reactions" % len(self.modified_shouts))
@staticmethod
async def recount_changed(session):
self = ReactedStorage
async with self.lock:
print('[stat.reacted] recounting...')
for slug in list(self.modified_shouts):
sss = list(self.modified_shouts)
c = 0
for slug in sss:
siblings = session.query(Reaction).where(Reaction.shout == slug).all()
c += len(siblings)
await self.recount(siblings)
print("[stat.reacted] %d reactions total" % c)
print("[stat.reacted] %d shouts" % len(self.modified_shouts))
print("[stat.reacted] %d topics" % len(self.reacted["topics"].values()))
print("[stat.reacted] %d shouts" % len(self.reacted["shouts"]))
print("[stat.reacted] %d authors" % len(self.reacted["authors"].values()))
print("[stat.reacted] %d reactions" % len(self.reacted["reactions"]))
print("[stat.reacted] %d reactions replied" % len(self.reacted["reactions"]))
self.modified_shouts = set([])
@staticmethod