Custom error handler and some misc fixes

This commit is contained in:
AAGaming
2024-05-25 19:14:54 -04:00
parent 96cc72f2ca
commit a84a13c76d
28 changed files with 1140 additions and 1126 deletions

View File

@@ -99,8 +99,10 @@ class PluginWrapper:
return self
def stop(self, uninstall: bool = False):
self._listener_task.cancel()
if hasattr(self, "_listener_task"):
self._listener_task.cancel()
async def _(self: PluginWrapper):
await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False))
await self._socket.close_socket_connection()
if hasattr(self, "_socket"):
await self._socket.write_single_line(dumps({ "stop": True, "uninstall": uninstall }, ensure_ascii=False))
await self._socket.close_socket_connection()
create_task(_(self))