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

Function persistProbeHealthResult

packages/core/sdk/src/executor.ts:5143–5158  ·  view source on GitHub ↗
(
      ref: ConnectionRef,
      result: HealthCheckResult,
    )

Source from the content-addressed store, hash-verified

5141 * landing even between the read and the UPDATE wins and the probe
5142 * verdict is a silent no-op. Best-effort, like every verdict write. */
5143 const persistProbeHealthResult = (
5144 ref: ConnectionRef,
5145 result: HealthCheckResult,
5146 ): Effect.Effect<void> =>
5147 findConnectionRow(ref).pipe(
5148 Effect.flatMap((fresh) =>
5149 fresh === null ||
5150 oauthReauthRequiredFromProviderState(fresh.provider_state) !== null ||
5151 // A credential verdict cannot refute a failed tool sync; only a
5152 // successful sync clears that record (see `isToolSyncHealth`).
5153 isToolSyncHealth(Option.getOrNull(decodeLastHealth(fresh.last_health)))
5154 ? Effect.void
5155 : persistHealthResult(ref, fresh, result),
5156 ),
5157 Effect.ignore,
5158 );
5159
5160 const connectionCheckHealth = (
5161 ref: ConnectionRef,

Callers 1

connectionCheckHealthFunction · 0.85

Calls 4

isToolSyncHealthFunction · 0.90
findConnectionRowFunction · 0.85
persistHealthResultFunction · 0.85

Tested by

no test coverage detected