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

Function attachToOwnedDataDirServerOrFail

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

Source from the content-addressed store, hash-verified

269 | { readonly kind: "attached"; readonly manifest: ExecutorLocalServerManifest };
270
271const attachToOwnedDataDirServerOrFail = (input: {
272 readonly lockPath: string;
273}): Effect.Effect<ExecutorLocalServerManifest, Error, FileSystem.FileSystem | PlatformPath.Path> =>
274 Effect.gen(function* () {
275 const manifest = yield* readReachableLocalServerHint();
276 if (manifest) return manifest;
277
278 const path = yield* PlatformPath.Path;
279 const dataDir = resolveExecutorDataDir(path);
280 return yield* Effect.fail(
281 new Error(
282 [
283 "Executor data directory is owned by another live process, but no reachable local server was advertised.",
284 `Data directory: ${dataDir}`,
285 `Ownership lock: ${input.lockPath}`,
286 "Wait for the existing process to finish starting, or stop it and retry.",
287 ].join("\n"),
288 ),
289 );
290 });
291
292const startServerOrAttachOwnedDataDir = (
293 options: StartServerOptions,

Callers 1

Calls 2

resolveExecutorDataDirFunction · 0.90

Tested by

no test coverage detected