(
slug: IntegrationSlug,
spec: HealthCheckSpec | null,
)
| 3471 | // No plugin hook, no config read-modify-write, nothing a plugin's own |
| 3472 | // config cycle can clobber. |
| 3473 | const integrationSetHealthCheck = ( |
| 3474 | slug: IntegrationSlug, |
| 3475 | spec: HealthCheckSpec | null, |
| 3476 | ): Effect.Effect<void, IntegrationNotFoundError | OrgWriteDeniedError | StorageFailure> => |
| 3477 | transaction( |
| 3478 | Effect.gen(function* () { |
| 3479 | yield* guardOrgWrite(); |
| 3480 | const row = yield* findIntegrationRow(slug); |
| 3481 | if (!row) return yield* new IntegrationNotFoundError({ slug }); |
| 3482 | yield* core.updateMany("integration", { |
| 3483 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 3484 | set: { health_check: spec, updated_at: new Date() }, |
| 3485 | }); |
| 3486 | }), |
| 3487 | ); |
| 3488 | |
| 3489 | // ------------------------------------------------------------------ |
| 3490 | // Per-connection tool production |
no test coverage detected