MCPcopy Create free account
hub / github.com/runhey/OnmyojiAutoScript / start

Method start

module/server/script_process.py:32–44  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30
31
32 async def start(self):
33 self.state = ScriptState.RUNNING
34 await self.broadcast_state({"state": self.state})
35 if self._process:
36 logger.warning(f'Script {self.config_name} is initialized')
37 if self._process and self._process.is_alive():
38 logger.warning(f'Script {self.config_name} is already running and first stop it')
39 self.stop()
40 self._process = multiprocessing.Process(target=func,
41 args=(self.config_name, self.state_queue, self.log_pipe_in,),
42 name=self.config_name,
43 daemon=True)
44 self._process.start()
45
46
47 async def stop(self):

Callers 4

__init__Method · 0.45
script_process.pyFile · 0.45
script_startFunction · 0.45
websocket_endpointFunction · 0.45

Calls 2

stopMethod · 0.95
broadcast_stateMethod · 0.80

Tested by

no test coverage detected