MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / shutdown

Function shutdown

apps/kimi-code/src/cli/sub/server/run.ts:308–323  ·  view source on GitHub ↗
(reason: string)

Source from the content-addressed store, hash-verified

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,

Callers 1

runServerInProcessFunction · 0.70

Calls 6

shutdownTelemetryFunction · 0.85
cancelMethod · 0.65
infoMethod · 0.65
closeMethod · 0.65
errorMethod · 0.65
exitMethod · 0.65

Tested by

no test coverage detected