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

Function awaitStaleSyncWithinGrace

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

Source from the content-addressed store, hash-verified

5071 // swallows its scan errors the same way each rebuild already swallows its
5072 // own.
5073 const awaitStaleSyncWithinGrace = (graceMs: number) =>
5074 Effect.gen(function* () {
5075 const fiber = yield* Effect.forkDetach(
5076 syncStaleConnectionTools.pipe(
5077 Effect.catch((error) =>
5078 Effect.logWarning("executor stale tool sync scan failed", {
5079 error: describeSyncFailure(error),
5080 }),
5081 ),
5082 ),
5083 );
5084 // On hosts that cancel request-scoped I/O once the response settles
5085 // (Cloudflare Workers), hand the host the rebuilds' completion so the
5086 // catalog still converges after the read stops waiting.
5087 config.waitUntil?.(
5088 new Promise<void>((resolve) => fiber.addObserver(() => resolve(undefined))),
5089 );
5090 yield* Fiber.await(fiber).pipe(Effect.timeoutOption(graceMs), Effect.asVoid);
5091 });
5092
5093 const toolsList = (filter?: ToolListFilter): Effect.Effect<readonly Tool[], StorageFailure> =>
5094 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