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

Function assertNoOtherActiveLocalServer

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

Source from the content-addressed store, hash-verified

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

Callers 2

runForegroundSessionFunction · 0.85
runDaemonSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected