(reason: string)
| 306 | : undefined; |
| 307 | |
| 308 | async function shutdown(reason: string): Promise<void> { |
| 309 | if (stopping) return; |
| 310 | stopping = true; |
| 311 | idle?.cancel(); |
| 312 | running?.logger.info({ reason }, 'server shutting down'); |
| 313 | try { |
| 314 | await running?.close(); |
| 315 | await shutdownTelemetry({ timeoutMs: CLI_SHUTDOWN_TIMEOUT_MS }); |
| 316 | } catch (error) { |
| 317 | running?.logger.error( |
| 318 | { err: error instanceof Error ? error : new Error(String(error)) }, |
| 319 | 'server shutdown error', |
| 320 | ); |
| 321 | } |
| 322 | process.exit(0); |
| 323 | } |
| 324 | |
| 325 | running = await startServer({ |
| 326 | host: options.host, |
no test coverage detected