(force: boolean)
| 148 | } |
| 149 | |
| 150 | protected async terminate(force: boolean): Promise<void> { |
| 151 | if (!this.appHasBeenToldToStopOrDetach) { |
| 152 | this.appHasBeenToldToStopOrDetach = true; |
| 153 | try { |
| 154 | if (this.currentRunningAppId && this.appHasStarted && !this.processExited && this.runDaemon) { |
| 155 | // Request to quit/detach, but don't await it since we sometimes |
| 156 | // don't get responses before the process quits. |
| 157 | void this.runDaemon.stop(this.currentRunningAppId); |
| 158 | |
| 159 | // Now wait for the process to terminate up to 3s. |
| 160 | await Promise.race([ |
| 161 | this.processExit, |
| 162 | new Promise((resolve) => setTimeout(resolve, 3000)), |
| 163 | ]); |
| 164 | } |
| 165 | } catch { |
| 166 | // Ignore failures here (we're shutting down and will send kill signals). |
| 167 | } |
| 168 | } |
| 169 | await super.terminate(force); |
| 170 | } |
| 171 | |
| 172 | protected async restartRequest( |
| 173 | response: DebugProtocol.RestartResponse, |
no test coverage detected