Skip to content

Stop analytics free-spin: 5s raw snapshot budget - #17

Merged
rivertam merged 1 commit into
mainfrom
fix/analytics-fail-fast
Aug 10, 2026
Merged

Stop analytics free-spin: 5s raw snapshot budget#17
rivertam merged 1 commit into
mainfrom
fix/analytics-fail-fast

Conversation

@rivertam

Copy link
Copy Markdown
Owner

Summary

  • After Paginate analytics reads; enable SurrealDB HTTP #15 + http:// endpoint, /analytics hung until a ~35s edge 502: the raw loader’s budget was 5s × day_count.
  • Hard-cap the entire raw snapshot at 5 seconds and stop paging when the budget is nearly gone so the standby card returns instead of a hung tab.

Test plan

  • just check
  • /analytics?range=7d returns HTML within ~5s (standby or metrics), not a long spinner / 502
  • Same for 90d

Made with Cursor

The paginated raw snapshot budget scaled with window length (5s × days), so
7d/90d held the request open until Cloudflare returned 502 — the free-spinning
analytics tab. Cap the whole raw path at five seconds and bail early between
pages so the standby card can render inside the proxy timeout.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rivertam
rivertam merged commit efbfa59 into main Aug 10, 2026
1 check passed
@rivertam
rivertam deleted the fix/analytics-fail-fast branch August 10, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant