From fc171deb79bfd7693cee40b7c3752c4ce08bd434 Mon Sep 17 00:00:00 2001 From: mabashian Date: Tue, 8 Jun 2021 16:08:39 -0400 Subject: [PATCH] Dont reconnect job output socket if it closes cleanly --- awx/ui_next/src/screens/Job/JobOutput/JobOutput.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/awx/ui_next/src/screens/Job/JobOutput/JobOutput.jsx b/awx/ui_next/src/screens/Job/JobOutput/JobOutput.jsx index 976952afc7..5395bdeb86 100644 --- a/awx/ui_next/src/screens/Job/JobOutput/JobOutput.jsx +++ b/awx/ui_next/src/screens/Job/JobOutput/JobOutput.jsx @@ -227,11 +227,13 @@ function connectJobSocket({ type, id }, onMessage) { }; ws.onclose = e => { - // eslint-disable-next-line no-console - console.debug('Socket closed. Reconnecting...', e); - setTimeout(() => { - connectJobSocket({ type, id }, onMessage); - }, 1000); + if (e.code !== 1000) { + // eslint-disable-next-line no-console + console.debug('Socket closed. Reconnecting...', e); + setTimeout(() => { + connectJobSocket({ type, id }, onMessage); + }, 1000); + } }; ws.onerror = err => {