mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
Only attempt to reconnect socket if connection wasn't closed cleanly
This commit is contained in:
@@ -33,9 +33,11 @@ export default function useWebsocket(subscribeGroups) {
|
|||||||
ws.current.onclose = e => {
|
ws.current.onclose = e => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.debug('Socket closed. Reconnecting...', e);
|
console.debug('Socket closed. Reconnecting...', e);
|
||||||
setTimeout(() => {
|
if (e.code !== 1000) {
|
||||||
connect();
|
setTimeout(() => {
|
||||||
}, 1000);
|
connect();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
ws.current.onerror = err => {
|
ws.current.onerror = err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user