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

Function updatePort

packages/server/src/lock.ts:267–277  ·  view source on GitHub ↗
(port: number)

Source from the content-addressed store, hash-verified

265 }
266 },
267 updatePort(port: number): void {
268 if (!existsSync(lockPath)) return;
269 const contents = readLockContents(lockPath);
270 // Only rewrite our own lock, and only when the port actually changed.
271 if (!contents || contents.pid !== ownerPid || contents.port === port) return;
272 try {
273 writeFileSync(lockPath, JSON.stringify({ ...contents, port }));
274 } catch {
275 // Best-effort: a concurrent release/takeover may have removed the file.
276 }
277 },
278 };
279}

Callers

nothing calls this directly

Calls 1

readLockContentsFunction · 0.85

Tested by

no test coverage detected