Fix webhook stat reporting

This commit is contained in:
Ske 2018-09-15 15:12:51 +02:00
parent 4becc8a4e9
commit 05cf04df03

View File

@ -32,6 +32,9 @@ class PluralKitBot:
self.stats = NullStatCollector()
self.channel_logger = channel_logger.ChannelLogger(self.client)
# "stats" passed here will be a NullStatsCollector, will get overwritten inside
# the Proxy object when the actual connection occurs
self.proxy = proxy.Proxy(self.client, token, self.channel_logger, self.stats)
async def on_error(self, evt, *args, **kwargs):
@ -136,6 +139,9 @@ class PluralKitBot:
os.environ["INFLUX_DB"]
)
# Overwrite the NullCollector passed to proxy
self.proxy.stats = self.stats
self.logger.info("Starting periodical stat reporting...")
asyncio.get_event_loop().create_task(self.periodical_stat_timer(self.pool))