Skip to contents

Checks that the latest observation timestamps in ingestion_stats are within an acceptable window of the current time.

Usage

validate_email_freshness(ingestion_stats, max_stale_hours = 96)

Arguments

ingestion_stats

Tibble with station_id and latest columns

max_stale_hours

Maximum acceptable age of data in hours (default: 96)

Value

ingestion_stats (invisibly), or aborts if ALL stations are stale

Examples

stats <- tibble::tibble(
  station_id = c("M2", "M3"),
  latest = Sys.time() - c(1, 2) * 3600
)
validate_email_freshness(stats)