Updated stream ws to close if backend api error
• Updated: - stream ws to close if backend api error and not retry over and over again
This commit is contained in:
parent
a42b7797d8
commit
72162affcf
@ -76,6 +76,10 @@ export default function getStream(streamingAPIBaseURL, accessToken, stream, { co
|
|||||||
const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);
|
const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);
|
||||||
|
|
||||||
ws.onopen = connected;
|
ws.onopen = connected;
|
||||||
|
ws.onerror = (e) => {
|
||||||
|
// If errors, dont retry
|
||||||
|
ws.close();
|
||||||
|
};
|
||||||
ws.onmessage = e => received(JSON.parse(e.data));
|
ws.onmessage = e => received(JSON.parse(e.data));
|
||||||
ws.onclose = disconnected;
|
ws.onclose = disconnected;
|
||||||
ws.onreconnect = reconnected;
|
ws.onreconnect = reconnected;
|
||||||
|
Loading…
Reference in New Issue
Block a user