Add scheduled DemoFamilyRefreshJob to rebuild demo data daily (#1217)

* Add scheduled demo family refresh job

Rebuild demo data daily at 5am UTC by anonymizing and enqueueing deletion of the existing demo family while immediately generating new sample data. Add super-admin email notifications with 24-hour session and signup metrics, plus tests for the new job and mailer.

* Delete demo monitoring key before family refresh

Ensure DemoFamilyRefreshJob removes ApiKey::DEMO_MONITORING_KEY from the old demo family before enqueueing async family destruction and generating replacement sample data. Adds a regression assertion that the key is gone before generator execution.
This commit is contained in:
Juan José Mata
2026-03-17 19:41:26 +01:00
committed by GitHub
parent 26aa260fb1
commit 53f478a77b
6 changed files with 195 additions and 0 deletions

View File

@@ -36,3 +36,9 @@ clean_inactive_families:
class: "InactiveFamilyCleanerJob"
queue: "scheduled"
description: "Archives and destroys families that expired their trial without subscribing (managed mode only)"
refresh_demo_family:
cron: "0 5 * * *" # daily at 5:00 AM UTC
class: "DemoFamilyRefreshJob"
queue: "scheduled"
description: "Refreshes demo family data and emails super admins with daily usage summary"