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

Function assertNoOtherActiveLocalServer

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

Source from the content-addressed store, hash-verified

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

Callers 2

runForegroundSessionFunction · 0.85
runDaemonSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected