renewal reminders: stop the hourly sweep from growing with every past checkout #324

Stängd
öppnade 2026-10-08 21:12:37 +00:00 av supernaut · 0 kommentarer
Ägare

What

The reminder job asks the identity provider and billing about every account that ever started a checkout, one at a time, every hour.

Why

The list never shrinks. Each account costs two calls with 10 second timeouts. At 1,000 accounts the run can pass its 10 minute abort. Overlapping runs are not guarded. Thresholds are whole days, so hourly adds load and no value.

Failing case

1,000 accounts at 300 ms per call give about 10 minutes per run. A slow billing service makes it longer, and the next tick starts a second run on top.

Fix

  • Change the interval in scripts/renewal-reminders.mjs to 6 or 24 hours. The first run after each start stays.
  • Add an in-flight flag so a tick is skipped while a run is active.
  • Process 5 accounts at a time.
  • Leave the claim and dedupe logic alone.

Done when

  • A test shows a second tick is skipped while the first runs.
  • A run over 200 stubbed accounts takes about a quarter of the sequential time.
  • No reminder is sent twice.
## What The reminder job asks the identity provider and billing about every account that ever started a checkout, one at a time, every hour. ## Why The list never shrinks. Each account costs two calls with 10 second timeouts. At 1,000 accounts the run can pass its 10 minute abort. Overlapping runs are not guarded. Thresholds are whole days, so hourly adds load and no value. ## Failing case 1,000 accounts at 300 ms per call give about 10 minutes per run. A slow billing service makes it longer, and the next tick starts a second run on top. ## Fix - Change the interval in `scripts/renewal-reminders.mjs` to 6 or 24 hours. The first run after each start stays. - Add an in-flight flag so a tick is skipped while a run is active. - Process 5 accounts at a time. - Leave the claim and dedupe logic alone. ## Done when - [ ] A test shows a second tick is skipped while the first runs. - [ ] A run over 200 stubbed accounts takes about a quarter of the sequential time. - [ ] No reminder is sent twice.
supernaut lade till detta till projektet Bitborg Web 2026-10-08 21:14:46 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web#324
Ingen beskrivning angiven.