(process: IInstanceProcess)
| 354 | // function that must be executed after the instance starts |
| 355 | // Trigger the open event and bind the data and exit events, etc. |
| 356 | started(process: IInstanceProcess) { |
| 357 | this.config.lastDatetime = Date.now(); |
| 358 | const outputCode = this.config.terminalOption.pty ? "utf-8" : this.config.oe; |
| 359 | process.on("data", (text: any) => { |
| 360 | this.pushOutput(iconv.decode(text, outputCode)); |
| 361 | }); |
| 362 | process.on("exit", (code: number) => this.stopped(code)); |
| 363 | this.process = process; |
| 364 | this.instanceStatus = Instance.STATUS_RUNNING; |
| 365 | this.emit("open", this); |
| 366 | |
| 367 | // start all lifecycle tasks |
| 368 | this.lifeCycleTaskManager.execLifeCycleTask(1); |
| 369 | this.startOutputLoop(); |
| 370 | } |
| 371 | |
| 372 | // If the instance performs any operation exception, it must throw an exception through this function |
| 373 | // trigger failure event |
no test coverage detected