diff --git a/backend/src/plugin.py b/backend/src/plugin.py index b57bc5f7f..ed401b45a 100644 --- a/backend/src/plugin.py +++ b/backend/src/plugin.py @@ -118,11 +118,11 @@ async def _on_new_message(self, message : str) -> str|None: if "stop" in data: self.log.info("Calling Loader unload function.") - await self._unload() get_event_loop().stop() while get_event_loop().is_running(): await sleep(0) get_event_loop().close() + await self._unload() raise Exception("Closing message listener") # TODO there is definitely a better way to type this