(
ref: ConnectionRef,
result: HealthCheckResult,
)
| 3227 | const unknownHealth = (): HealthCheckResult => ({ status: "unknown", checkedAt: Date.now() }); |
| 3228 | |
| 3229 | const persistHealthResult = ( |
| 3230 | ref: ConnectionRef, |
| 3231 | result: HealthCheckResult, |
| 3232 | ): Effect.Effect<void, never> => |
| 3233 | core |
| 3234 | .updateMany("connection", { |
| 3235 | where: (b: AnyCb) => |
| 3236 | b.and( |
| 3237 | b("owner", "=", String(ref.owner)), |
| 3238 | b("integration", "=", String(ref.integration)), |
| 3239 | b("name", "=", String(ref.name)), |
| 3240 | ), |
| 3241 | set: { last_health: result, updated_at: new Date() }, |
| 3242 | }) |
| 3243 | .pipe(Effect.ignore); |
| 3244 | |
| 3245 | const healthFromCredentialResolutionError = ( |
| 3246 | err: CredentialResolutionError, |
no outgoing calls
no test coverage detected