MCPcopy Index your code
hub / github.com/deepnote/deepnote / stopServer

Function stopServer

packages/runtime-core/src/server-starter.ts:104–124  ·  view source on GitHub ↗
(info: ServerInfo)

Source from the content-addressed store, hash-verified

102 * Stop the deepnote-toolkit server.
103 */
104export async function stopServer(info: ServerInfo): Promise<void> {
105 if (info.process.exitCode !== null) return
106
107 // Try graceful shutdown first
108 info.process.kill('SIGTERM')
109
110 // Wait briefly for graceful exit
111 await new Promise<void>(resolve => {
112 const timeout = setTimeout(() => {
113 if (info.process.exitCode === null) {
114 info.process.kill('SIGKILL')
115 }
116 void resolve()
117 }, 2000)
118
119 info.process.once('exit', () => {
120 clearTimeout(timeout)
121 void resolve()
122 })
123 })
124}
125
126/**
127 * Find two consecutive available ports starting from the given port.

Callers 2

stopMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected