(state: BackState, processId: string)
| 294 | } |
| 295 | |
| 296 | export async function removeService(state: BackState, processId: string): Promise<void> { |
| 297 | const service = state.services.get(processId); |
| 298 | if (service) { |
| 299 | await waitForServiceDeath(service); |
| 300 | state.services.delete(processId); |
| 301 | state.apiEmitters.services.onServiceRemove.fire(service); |
| 302 | state.socketServer.broadcast(BackOut.SERVICE_REMOVED, processId); |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | export async function waitForServiceDeath(service: ManagedChildProcess) : Promise<void> { |
| 307 | if (service.getState() !== ProcessState.STOPPED) { |
no test coverage detected