(self)
| 45 | |
| 46 | |
| 47 | async def stop(self): |
| 48 | self.state = ScriptState.INACTIVE |
| 49 | await self.broadcast_state({"state": self.state}) |
| 50 | if self._process is None: |
| 51 | logger.warning(f'Script {self.config_name} process is removed') |
| 52 | return |
| 53 | if not self._process.is_alive(): |
| 54 | logger.warning(f'Script {self.config_name} is not running') |
| 55 | return |
| 56 | self._process.terminate() |
| 57 | self._process = None |
| 58 | |
| 59 | async def coroutine_broadcast_state(self): |
| 60 | try: |
no test coverage detected