configData.database?.url was removed from the prod configmap (database
credentials belong in secrets), but the code only checked configData.
Add secretsData.database?.url as a fallback so prod can supply the URL
via the gateway-secrets Secret.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When send() was called while the socket was still CONNECTING (state 0,
not yet OPEN), it queued the message and scheduled a reconnect after 1
second. The socket then connected successfully, but 1 second later the
scheduled reconnect fired and closed the working session (code 1005),
disrupting any in-flight requests (e.g. get_bars).
Two fixes:
1. Don't schedule a reconnect when the socket is CONNECTING — it is
already in the process of connecting, no reconnect needed.
2. Cancel any pending reconnect timer in onopen — if a timer was
already scheduled before the connection succeeded, clear it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CloudFlare drops idle WebSocket connections after ~100 seconds.
Ping every 30 seconds to prevent this.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TradingView's SaveloadAdapter.Library was making HTTP requests for study
templates that returned HTML from nginx, causing JSON parse errors that
destroyed the datafeed and disconnected the WebSocket.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>