Skip to main content

sweep_expired

Function sweep_expired 

Source
pub async fn sweep_expired() -> Option<u64>
Expand description

Purge every message whose NIP-40 expiry has passed: drop it from STATE and the DB, remove cached attachment files no sibling still needs, and — for OUR OWN file messages — issue a Blossom blob delete (blobs carry no self-expiry). Emits message_removed with reason “self-destruct” per purged row so the UI can derez it.

Local-only: every client honors the same NIP-40 tag independently, so no delete is broadcast. Safe to call repeatedly (a ticker + a boot catch-up).