diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js index 12ee00cba3..4efe1b6f3c 100644 --- a/awx/ui/static/js/app.js +++ b/awx/ui/static/js/app.js @@ -76,7 +76,7 @@ var tower = angular.module('Tower', [ 'UserFormDefinition', 'FormGenerator', 'OrganizationListDefinition', - 'jobTemplates', + 'jobTemplates', 'UserListDefinition', 'UserHelper', 'PromptDialog', @@ -508,7 +508,7 @@ var tower = angular.module('Tower', [ LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp, ConfigureTower, CreateCustomInventory) { - var e, html, sock, checkCount = 0; + var e, html, sock; function detectBrowser() { var ua = window.navigator.userAgent, @@ -611,25 +611,6 @@ var tower = angular.module('Tower', [ $log.debug('socket status: ' + $rootScope.socketStatus); }); },2000); - - // monitor socket status - checkCount = 0; - $rootScope.dashboardInterval = setInterval(function() { - if (sock.checkStatus() === 'error' || checkCount > 5) { - // there's an error or we're stuck in a 'connecting' state. attempt to reconnect - $log.debug('socket status: ' + sock.checkStatus()); - $log.debug('attempting new socket connection'); - sock = null; - openSocket(); - checkCount = 0; - } - else if (sock.checkStatus() === 'connecting') { - checkCount++; - } - else { - checkCount = 0; - } - }, 5000); }); $rootScope.$on("$routeChangeStart", function (event, next) { @@ -645,10 +626,6 @@ var tower = angular.module('Tower', [ if ($rootScope.jobStdOutInterval) { window.clearInterval($rootScope.jobStdOutInterval); } - if ($rootScope.checkSocketConnectionInterval) { - // use to monitor and restart socket connections - window.clearInterval($rootScope.checkSocketConnectionInterval); - } // On each navigation request, check that the user is logged in if (!/^\/(login|logout)/.test($location.path())) { @@ -665,9 +642,6 @@ var tower = angular.module('Tower', [ // gets here on timeout if (next.templateUrl !== (urlPrefix + 'partials/login.html')) { $rootScope.sessionTimer.expireSession(); - if($rootScope.dashboardInterval){ - window.clearInterval($rootScope.dashboardInterval); - } if (sock) { sock.socket.socket.disconnect(); } diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index d4c3942a4f..4a66b09f72 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -24,8 +24,7 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r refresh_count = 0, lastEventId = 0, verbosity_options, - job_type_options, - checkCount = 0; + job_type_options; scope.plays = []; scope.hosts = []; @@ -107,22 +106,6 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r } openSocket(); - $rootScope.checkSocketConnectionInterval = setInterval(function() { - if (event_socket.checkStatus() === 'error' || checkCount > 2) { - // there's an error or we're stuck in a 'connecting' state. attempt to reconnect - $log.debug('job detail page: initializing and restarting socket connections'); - event_socket = null; - openSocket(); - checkCount = 0; - } - else if (event_socket.checkStatus() === 'connecting') { - checkCount++; - } - else { - checkCount = 0; - } - }, 3000); - if ($rootScope.removeJobStatusChange) { $rootScope.removeJobStatusChange(); } diff --git a/awx/ui/static/js/controllers/JobStdout.js b/awx/ui/static/js/controllers/JobStdout.js index 8035ec7326..b22eef2a77 100644 --- a/awx/ui/static/js/controllers/JobStdout.js +++ b/awx/ui/static/js/controllers/JobStdout.js @@ -29,8 +29,7 @@ export function JobStdoutController ($log, $rootScope, $scope, $compile, $routeP page_size = 500, lastScrollTop = 0, st, - direction, - checkCount = 0; + direction; function openSockets() { @@ -72,23 +71,6 @@ export function JobStdoutController ($log, $rootScope, $scope, $compile, $routeP } openSockets(); - $rootScope.checkSocketConnectionInterval = setInterval(function() { - if (status_socket.checkStatus() === 'error' || checkCount > 2) { - // there's an error or we're stuck in a 'connecting' state. attempt to reconnect - $log.debug('stdout page: initializing and restarting socket connections'); - status_socket = null; - event_socket = null; - openSockets(); - checkCount = 0; - } - else if (status_socket.checkStatus() === 'connecting') { - checkCount++; - } - else { - checkCount = 0; - } - }, 3000); - $rootScope.jobStdOutInterval = setInterval( function() { if (event_queue > 0) { // events happened since the last check @@ -272,4 +254,3 @@ export function JobStdoutController ($log, $rootScope, $scope, $compile, $routeP JobStdoutController.$inject = [ '$log', '$rootScope', '$scope', '$compile', '$routeParams', 'ClearScope', 'GetBasePath', 'Wait', 'Rest', 'ProcessErrors', 'Socket' ]; - diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index 76f5617df4..550b1ff168 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -25,7 +25,7 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa api_complete = false, schedule_socket, job_socket, - max_rows, checkCount=0; + max_rows; function openSockets() { job_socket = Socket({ @@ -50,23 +50,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa }); } - $rootScope.checkSocketConnectionInterval = setInterval(function() { - if (job_socket.checkStatus() === 'error' || checkCount > 2) { - // there's an error or we're stuck in a 'connecting' state. attempt to reconnect - $log.debug('jobs page: initializing and restarting socket connections'); - job_socket = null; - schedule_socket = null; - openSockets(); - checkCount = 0; - } - else if (job_socket.checkStatus() === 'connecting') { - checkCount++; - } - else { - checkCount = 0; - } - }, 3000); - function processEvent(event) { switch(event.status) { case 'running': diff --git a/awx/ui/static/js/shared/Socket.js b/awx/ui/static/js/shared/Socket.js index 9f676a6bed..1b54d626e6 100644 --- a/awx/ui/static/js/shared/Socket.js +++ b/awx/ui/static/js/shared/Socket.js @@ -80,8 +80,8 @@ angular.module('SocketIO', ['AuthService', 'Utilities']) }, 'connect timeout': 3000, 'try multiple transports': false, - 'max reconnection attempts': 3, - 'reconnection limit': 10000, + 'max reconnection attempts': 10, + 'reconnection limit': 2000, 'force new connection': true }); @@ -107,9 +107,6 @@ angular.module('SocketIO', ['AuthService', 'Utilities']) if (token_actual === token) { self.socket.socket.disconnect(); - if($rootScope.dashboardInterval){ - window.clearInterval($rootScope.dashboardInterval); - } } self.scope.$apply(function () {