Skip to content

Commit

Permalink
fix start/stop methods
Browse files Browse the repository at this point in the history
  • Loading branch information
marios8543 committed Oct 18, 2023
1 parent 88250b3 commit 934b1b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ async def execute_method(self, method_name: str, kwargs: Dict[Any, Any]):

return await request.wait_for_result()

async def start(self):
def start(self):
if self.passive:
return self
Process(target=self.sandboxed_plugin.initialize, args=[self._socket]).start()
self.listener_task = create_task(self._response_listener())
return self

async def stop(self):
def stop(self):
self._listener_task.cancel()
async def _(self: PluginWrapper):
await self._socket.write_single_line(dumps({ "stop": True }, ensure_ascii=False))
Expand Down

0 comments on commit 934b1b3

Please sign in to comment.