16 Readiness and health
| (require commerce/health) | package: commerce |
Processes explicitly require commerce/health.
struct
(struct health-warning (code detail))
code : symbol? detail : hash?
One typed warning.
struct
(struct health-status (readiness warnings))
readiness : any/c warnings : (listof health-warning?)
One read-only aggregate: the readiness snapshot (schema version, journal and
projection counts, pending and processing issuance work with a stale-lease
count, the oldest pending availability time, and claim state counts
including the window-passed count) plus the typed warnings.
procedure
(health-report storage #:now now) → health-status?
storage : commerce-storage? now : exact-nonnegative-integer?
Classifies the snapshot into typed warnings —
'projection-blocked, 'issuance-lease-expired,
'claim-window-passed. Nothing mutates; an HTTP edge renders this
value.
procedure
(health-report! storage #:now now) → health-status?
storage : commerce-storage? now : exact-nonnegative-integer?
The logging variant: emits the warnings on the commerce topic.