-
Notifications
You must be signed in to change notification settings - Fork 1
SSE connection limits — replace with polling or WebSocket #12
Copy link
Copy link
Open
Labels
Description
Problem
`main.py:214-247` — each enrollment opens an SSE stream that polls the DB every 5 seconds for up to 30 minutes. At 100 concurrent enrollments = 100 persistent connections, each hitting the DB every 5s.
Solution
- Replace SSE with client-side polling (exponential backoff: 2s → 5s → 10s → 30s)
- Or use WebSocket with server-push on actual state changes
- Add max concurrent SSE connections guard
Files
- `main.py` — SSE endpoint (lines 214-247)
Acceptance Criteria
- No long-lived connections per enrollment
- DB polling reduced by 90%+
Reactions are currently unavailable