(self)
| 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): |
no test coverage detected