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

Function attachToOwnedDataDirServerOrFail

apps/cli/src/main.ts:288–307  ·  view source on GitHub ↗
(input: {
  readonly lockPath: string;
})

Source from the content-addressed store, hash-verified

286 | { readonly kind: "attached"; readonly manifest: ExecutorLocalServerManifest };
287
288const attachToOwnedDataDirServerOrFail = (input: {
289 readonly lockPath: string;
290}): Effect.Effect<ExecutorLocalServerManifest, Error, FileSystem.FileSystem | PlatformPath.Path> =>
291 Effect.gen(function* () {
292 const manifest = yield* readReachableLocalServerHint();
293 if (manifest) return manifest;
294
295 const path = yield* PlatformPath.Path;
296 const dataDir = resolveExecutorDataDir(path);
297 return yield* Effect.fail(
298 new Error(
299 [
300 "Executor data directory is owned by another live process, but no reachable local server was advertised.",
301 `Data directory: ${dataDir}`,
302 `Ownership lock: ${input.lockPath}`,
303 "Wait for the existing process to finish starting, or stop it and retry.",
304 ].join("\n"),
305 ),
306 );
307 });
308
309const startServerOrAttachOwnedDataDir = (
310 options: StartServerOptions,

Callers 1

Calls 2

resolveExecutorDataDirFunction · 0.90

Tested by

no test coverage detected