don't initialize notifier multiple times

This commit is contained in:
əlemi 2022-04-19 03:14:34 +02:00
parent 6813181800
commit 148c809628
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E
2 changed files with 1 additions and 3 deletions

View file

@ -30,6 +30,7 @@ def main():
obj = getattr(m, obj_name) obj = getattr(m, obj_name)
if obj != Addon and inspect.isclass(obj) and issubclass(obj, Addon): if obj != Addon and inspect.isclass(obj) and issubclass(obj, Addon):
addons.append(obj) addons.append(obj)
break
help_text = '\n\naddons:' help_text = '\n\naddons:'

View file

@ -207,7 +207,6 @@ class Treepuncher(
await super().start() await super().start()
if not self.notifier: if not self.notifier:
self.notifier = Notifier() self.notifier = Notifier()
await self.notifier.initialize()
for m in self.modules: for m in self.modules:
await m.initialize() await m.initialize()
self._processing = True self._processing = True
@ -225,8 +224,6 @@ class Treepuncher(
await self.join_callbacks() await self.join_callbacks()
for m in self.modules: for m in self.modules:
await m.cleanup() await m.cleanup()
if self.notifier:
await self.notifier.cleanup()
await super().stop() await super().stop()
self.logger.info("Treepuncher stopped") self.logger.info("Treepuncher stopped")