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

Function persistHealthResult

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

Source from the content-addressed store, hash-verified

2705 const unknownHealth = (): HealthCheckResult => ({ status: "unknown", checkedAt: Date.now() });
2706
2707 const persistHealthResult = (
2708 ref: ConnectionRef,
2709 result: HealthCheckResult,
2710 ): Effect.Effect<void, never> =>
2711 core
2712 .updateMany("connection", {
2713 where: (b: AnyCb) =>
2714 b.and(
2715 b("owner", "=", String(ref.owner)),
2716 b("integration", "=", String(ref.integration)),
2717 b("name", "=", String(ref.name)),
2718 ),
2719 set: { last_health: result, updated_at: new Date() },
2720 })
2721 .pipe(Effect.ignore);
2722
2723 const healthFromCredentialResolutionError = (
2724 err: CredentialResolutionError,

Callers 1

connectionCheckHealthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected