What's changed
Refactor (1)
- userReports: simplify snapshot run lock (#7359)
The billing and usage data behind the admin User Reports screen
refreshes about twice as often (roughly every 4 hours instead of every
8) and is more robust against duplicate refresh jobs, without adding any
extra load on the database.👷 Description for instance maintainers
The background job that precomputes billing and usage figures
(refresh_user_report_snapshots) now checks in every 15 minutes but
only starts a brand-new refresh cycle once the last one finished at
leastUSER_REPORTS_SNAPSHOT_MIN_INTERVAL_HOURSago (default 4h,
env-overridable, was a fixed every-8-hours schedule). A cycle already in
progress always resumes regardless of that cooldown. No new database
fields or migrations.
Bug Fix (1)
- usage: batch usage queries by billing window (#7358)
Fixes a background job that could overload the database and disrupt service when checking which accounts are approaching their usage limits.
Full Changelog: https://github.com/kobotoolbox/kpi/compare/2.026.27d..2.026.27e