From 148c8096286122bb020d8c30793df889a7a19fed Mon Sep 17 00:00:00 2001 From: alemidev Date: Tue, 19 Apr 2022 03:14:34 +0200 Subject: [PATCH] don't initialize notifier multiple times --- src/treepuncher/__main__.py | 1 + src/treepuncher/treepuncher.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/treepuncher/__main__.py b/src/treepuncher/__main__.py index 8ca1e82..6bba175 100644 --- a/src/treepuncher/__main__.py +++ b/src/treepuncher/__main__.py @@ -30,6 +30,7 @@ def main(): obj = getattr(m, obj_name) if obj != Addon and inspect.isclass(obj) and issubclass(obj, Addon): addons.append(obj) + break help_text = '\n\naddons:' diff --git a/src/treepuncher/treepuncher.py b/src/treepuncher/treepuncher.py index c3c3e1d..bf81ea8 100644 --- a/src/treepuncher/treepuncher.py +++ b/src/treepuncher/treepuncher.py @@ -207,7 +207,6 @@ class Treepuncher( await super().start() if not self.notifier: self.notifier = Notifier() - await self.notifier.initialize() for m in self.modules: await m.initialize() self._processing = True @@ -225,8 +224,6 @@ class Treepuncher( await self.join_callbacks() for m in self.modules: await m.cleanup() - if self.notifier: - await self.notifier.cleanup() await super().stop() self.logger.info("Treepuncher stopped")