MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / assertNoOtherActiveLocalServer

Function assertNoOtherActiveLocalServer

apps/cli/src/main.ts:367–384  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365// (openOwnedLocalDatabase) is. A stale/missing manifest only costs the nice
366// message; the kernel lock still refuses a second owner.
367const assertNoOtherActiveLocalServer = (): Effect.Effect<
368 void,
369 Error,
370 FileSystem.FileSystem | PlatformPath.Path
371> =>
372 Effect.gen(function* () {
373 const active = yield* readActiveLocalServerManifest();
374 if (!active || active.pid === process.pid) return;
375 return yield* Effect.fail(
376 new Error(
377 [
378 `A local Executor ${active.kind} is already running at ${active.connection.origin} (pid ${active.pid}).`,
379 `It owns the current data directory: ${active.dataDir}`,
380 "Stop it before starting another local server.",
381 ].join("\n"),
382 ),
383 );
384 });
385
386const takeOverActiveLocalServer = (input?: {
387 readonly onlyKind?: ExecutorLocalServerKind;

Callers 2

runForegroundSessionFunction · 0.85
runDaemonSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected