mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40:52 +00:00
fix(environment): keep one account from draining the Open-Meteo budget
The backfill route shared the analytics-read bucket and sent every explicit range without a key, so one account could queue two-year backfills until the instance-wide daily budget was gone for everyone. The route now allows three backfills a rolling hour per account (429 environment.backfill_rate_limited) and one queued backfill per twenty-minute slot, keyed on the account (409 environment.backfill_pending). Every fetch made for an account is also charged to that account's own share of the daily budget, one twentieth of it, so a refused request ends the run as budget-blocked and the nightly run continues.
This commit is contained in:
1 parent
78cde56542
commit
509166afc4
12 files changed
+309
-59
No files matched your search
@@ -177,6 +177,8 @@ export const ERROR_CODE_CATALOGUE: Readonly<Record<string, readonly string[]>> =
|
||||
],
|
||||
encryption: ["encryption.keyBackup.stale", "encryption.key_mismatch"],
|
||||
environment: [
|
||||
"environment.backfill_pending",
|
||||
"environment.backfill_rate_limited",
|
||||
"environment.invalid",
|
||||
"environment.no_home",
|
||||
"environment.range_too_large",
|
||||
|
||||
Reference in new issue
Block a user