Skip to content

Commit

Permalink
Revert "Call plugin unload function after stopping event loop (#539)" (
Browse files Browse the repository at this point in the history
…#584)

This reverts commit 39f4f28 , because functions (seemingly) don't run after the event loop closes, so the unload function is never actually run.
  • Loading branch information
PartyWumpus authored Feb 9, 2024
1 parent fd4ed81 commit 2500b74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2500b74

Please sign in to comment.