Skip to main content

send_digest

Function send_digest 

Source
pub fn send_digest(
    ctx: &Ctx,
) -> impl Future<Output = Result<usize>> + Send + use<>
Expand description

Emails one digest of the alerts held back by the hourly cap, forgets alerts older than KEEP_DAYS, and returns how many alerts the digest listed.

Run it from a schedule (every 15 minutes is plenty): nothing is sent when no alert was held back. Safe to run twice at once: claiming the alerts is one UPDATE.

ยงErrors

A D1 or mail error; the held alerts then wait for the next run.