(
ref: ConnectionRef,
result: HealthCheckResult,
)
| 2721 | const unknownHealth = (): HealthCheckResult => ({ status: "unknown", checkedAt: Date.now() }); |
| 2722 | |
| 2723 | const persistHealthResult = ( |
| 2724 | ref: ConnectionRef, |
| 2725 | result: HealthCheckResult, |
| 2726 | ): Effect.Effect<void, never> => |
| 2727 | core |
| 2728 | .updateMany("connection", { |
| 2729 | where: (b: AnyCb) => |
| 2730 | b.and( |
| 2731 | b("owner", "=", String(ref.owner)), |
| 2732 | b("integration", "=", String(ref.integration)), |
| 2733 | b("name", "=", String(ref.name)), |
| 2734 | ), |
| 2735 | set: { last_health: result, updated_at: new Date() }, |
| 2736 | }) |
| 2737 | .pipe(Effect.ignore); |
| 2738 | |
| 2739 | const healthFromCredentialResolutionError = ( |
| 2740 | err: CredentialResolutionError, |
no outgoing calls
no test coverage detected