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

Function awaitStaleSyncWithinGrace

packages/core/sdk/src/executor.ts:5545–5563  ·  view source on GitHub ↗
(graceMs: number)

Source from the content-addressed store, hash-verified

5543 // swallows its scan errors the same way each rebuild already swallows its
5544 // own.
5545 const awaitStaleSyncWithinGrace = (graceMs: number) =>
5546 Effect.gen(function* () {
5547 const fiber = yield* Effect.forkDetach(
5548 syncStaleConnectionTools.pipe(
5549 Effect.catch((error) =>
5550 Effect.logWarning("executor stale tool sync scan failed", {
5551 error: describeSyncFailure(error),
5552 }),
5553 ),
5554 ),
5555 );
5556 // On hosts that cancel request-scoped I/O once the response settles
5557 // (Cloudflare Workers), hand the host the rebuilds' completion so the
5558 // catalog still converges after the read stops waiting.
5559 config.waitUntil?.(
5560 new Promise<void>((resolve) => fiber.addObserver(() => resolve(undefined))),
5561 );
5562 yield* Fiber.await(fiber).pipe(Effect.timeoutOption(graceMs), Effect.asVoid);
5563 });
5564
5565 const toolsList = (filter?: ToolListFilter): Effect.Effect<readonly Tool[], StorageFailure> =>
5566 Effect.gen(function* () {

Callers 1

toolsListFunction · 0.85

Calls 3

describeSyncFailureFunction · 0.85
waitUntilMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected