Kaizen
Browse modulesBookingsbookings/serverTypes

Type Alias: StalenessOptions

type StalenessOptions = {
  maxAdvanceMs: number;
  maxSweepLagMs?: number;
  onAlert?: (report: StalenessReport) => void | Promise<void>;
};

Defined in: server/bookings/scheduler-health.ts:94

Per-call options for staleness().

Properties

maxAdvanceMs

maxAdvanceMs: number;

Defined in: server/bookings/scheduler-health.ts:103

How far ahead (in ms) materializedThrough must reach from now for a series to be considered fresh. Typically maxAdvanceDays * 24 * 3600_000.

Both the booking-series and availability materializers must stay at least this far ahead (spec §11 / §6.8 "fail-open beyond the horizon" / §6.9 "fail-closed beyond the horizon").


maxSweepLagMs?

optional maxSweepLagMs?: number;

Defined in: server/bookings/scheduler-health.ts:108

How long (in ms) a sweeper can go without emitting an event before it is considered stale. Defaults to 4 hours — a typical "dead cron" signal.


onAlert?

optional onAlert?: (report: StalenessReport) => void | Promise<void>;

Defined in: server/bookings/scheduler-health.ts:115

Optional alert hook — called once when any stale entries are found. Wire to your monitoring (Sentry, PagerDuty, Slack webhook, etc.). The hook is called AFTER the report is assembled; a throwing hook does NOT affect the returned report.

Parameters

ParameterType
reportStalenessReport

Returns

void | Promise<void>

On this page