@meet-ai/cli 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -127,10 +127,15 @@ function createClient(baseUrl, apiKey) {
|
|
|
127
127
|
const ws = new WebSocket(`${wsUrl}/api/rooms/${roomId}/ws${tokenParam}`);
|
|
128
128
|
const connectTimeout = setTimeout(() => {
|
|
129
129
|
if (ws.readyState !== WebSocket.OPEN) {
|
|
130
|
-
wsLog({ event: "timeout", after_ms:
|
|
131
|
-
|
|
130
|
+
wsLog({ event: "timeout", after_ms: 30000 });
|
|
131
|
+
try {
|
|
132
|
+
ws.close(4000, "connect timeout");
|
|
133
|
+
} catch {}
|
|
134
|
+
const delay = getReconnectDelay();
|
|
135
|
+
wsLog({ event: "reconnecting", attempt: reconnectAttempt, delay_ms: Math.round(delay) });
|
|
136
|
+
setTimeout(connect, delay);
|
|
132
137
|
}
|
|
133
|
-
},
|
|
138
|
+
}, 30000);
|
|
134
139
|
ws.onopen = async () => {
|
|
135
140
|
clearTimeout(connectTimeout);
|
|
136
141
|
const wasReconnect = reconnectAttempt > 0;
|