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

Function attachToOwnedDataDirServerOrFail

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

resolveExecutorDataDirFunction · 0.90

Tested by

no test coverage detected