(
ref: ConnectionRef,
result: HealthCheckResult,
)
| 2804 | const unknownHealth = (): HealthCheckResult => ({ status: "unknown", checkedAt: Date.now() }); |
| 2805 | |
| 2806 | const persistHealthResult = ( |
| 2807 | ref: ConnectionRef, |
| 2808 | result: HealthCheckResult, |
| 2809 | ): Effect.Effect<void, never> => |
| 2810 | core |
| 2811 | .updateMany("connection", { |
| 2812 | where: (b: AnyCb) => |
| 2813 | b.and( |
| 2814 | b("owner", "=", String(ref.owner)), |
| 2815 | b("integration", "=", String(ref.integration)), |
| 2816 | b("name", "=", String(ref.name)), |
| 2817 | ), |
| 2818 | set: { last_health: result, updated_at: new Date() }, |
| 2819 | }) |
| 2820 | .pipe(Effect.ignore); |
| 2821 | |
| 2822 | const healthFromCredentialResolutionError = ( |
| 2823 | err: CredentialResolutionError, |
no outgoing calls
no test coverage detected