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

Function attachToOwnedDataDirServerOrFail

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

resolveExecutorDataDirFunction · 0.90

Tested by

no test coverage detected