MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / killActiveServers

Function killActiveServers

packages/cli/src/server/portUtils.ts:304–320  ·  view source on GitHub ↗
(startPort = 3002)

Source from the content-addressed store, hash-verified

302 * Returns the number of servers killed.
303 */
304export async function killActiveServers(startPort = 3002): Promise<number> {
305 const servers = await scanActiveServers(startPort);
306 let killed = 0;
307
308 for (const server of servers) {
309 if (server.pid) {
310 try {
311 process.kill(parseInt(server.pid, 10), "SIGTERM");
312 killed++;
313 } catch {
314 // Process may have already exited
315 }
316 }
317 }
318
319 return killed;
320}
321
322// ── Smart port selection ───────────────────────────────────────────────────
323

Callers 1

runFunction · 0.85

Calls 2

scanActiveServersFunction · 0.85
killMethod · 0.80

Tested by

no test coverage detected