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

Function assertNoOtherActiveLocalServer

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

Source from the content-addressed store, hash-verified

351// (openOwnedLocalDatabase) is. A stale/missing manifest only costs the nice
352// message; the kernel lock still refuses a second owner.
353const assertNoOtherActiveLocalServer = (): Effect.Effect<
354 void,
355 Error,
356 FileSystem.FileSystem | PlatformPath.Path
357> =>
358 Effect.gen(function* () {
359 const active = yield* readActiveLocalServerManifest();
360 if (!active || active.pid === process.pid) return;
361 return yield* Effect.fail(
362 new Error(
363 [
364 `A local Executor ${active.kind} is already running at ${active.connection.origin} (pid ${active.pid}).`,
365 `It owns the current data directory: ${active.dataDir}`,
366 "Stop it before starting another local server.",
367 ].join("\n"),
368 ),
369 );
370 });
371
372const takeOverActiveLocalServer = (input?: {
373 readonly onlyKind?: ExecutorLocalServerKind;

Callers 2

runForegroundSessionFunction · 0.85
runDaemonSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected