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