Skip to main content
For expensive checks (database, external APIs), run them on a timer and serve probes from cache.
Skip kit.start() on serverless platforms. Run checks on demand there, and use scheduling only in long-lived processes.

Behavior

  • start() is idempotent; a second call does nothing.
  • stop() clears intervals and the cache.
  • When a cached result is used, that check’s latency is 0 and cachedAt is an ISO timestamp on the check result.
Scheduled runs call adapter.check() directly (there is no per-request timeout wrapper in the scheduler). Timeouts still apply when there is no cache entry and the probe runs the check on demand. Timers use unref when available so they do not keep the process alive by themselves.