Skip to main content

Module retention

Module retention 

Source
Expand description

Analytics retention — delete events older than N days. Run per tenant at boot (servers restart/redeploy regularly).

Constants§

DEFAULT_RETENTION_DAYS
Default retention window when the tenant hasn’t configured one.

Functions§

prune
Delete events older than days. days <= 0 is a no-op (never wipe the whole table implicitly).
retention_days
Resolve the retention window from the "analytics" SiteSetting scope (retention_days), falling back to DEFAULT_RETENTION_DAYS.