From 89c02d77ae8133fa5e70c8a684636feeeceaafbc Mon Sep 17 00:00:00 2001 From: David Copeland Date: Fri, 20 Jan 2017 08:21:37 -0500 Subject: [PATCH] remove refresh from the failed page (#70) * remove refresh from the failed page The failed page is fairly expensive and so this disables auto-refresh on that page, as it is of less overall value here and ends up hitting the app more frequently than is useful * change to 1 minute auto-refresh --- .../javascripts/controllers/FailedController.coffee | 8 +++----- app/assets/javascripts/services/IntervalRefresh.coffee | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/controllers/FailedController.coffee b/app/assets/javascripts/controllers/FailedController.coffee index 68c7d9a..49f1347 100644 --- a/app/assets/javascripts/controllers/FailedController.coffee +++ b/app/assets/javascripts/controllers/FailedController.coffee @@ -1,7 +1,7 @@ controllers = angular.module("controllers") controllers.controller("FailedController", [ - "$scope", "$modal", "$routeParams", "$location", "$timeout", "$animate", "IntervalRefresh", "Resques", "GenericErrorHandling", "FailedJobs", "flash", - ($scope , $modal , $routeParams , $location , $timeout , $animate , IntervalRefresh , Resques , GenericErrorHandling , FailedJobs , flash)-> + "$scope", "$modal", "$routeParams", "$location", "$timeout", "$animate", "Resques", "GenericErrorHandling", "FailedJobs", "flash", + ($scope , $modal , $routeParams , $location , $timeout , $animate , Resques , GenericErrorHandling , FailedJobs , flash)-> DEFAULT_PAGE_SIZE = 10 @@ -138,7 +138,5 @@ controllers.controller("FailedController", [ $scope.currentPage = parseInt($routeParams.page or "1") $scope.refresh = loadFailedJobs - IntervalRefresh($scope.refresh,$scope) - - + loadFailedJobs() ]) diff --git a/app/assets/javascripts/services/IntervalRefresh.coffee b/app/assets/javascripts/services/IntervalRefresh.coffee index 09a8629..9ec8ed6 100644 --- a/app/assets/javascripts/services/IntervalRefresh.coffee +++ b/app/assets/javascripts/services/IntervalRefresh.coffee @@ -3,7 +3,7 @@ services = angular.module('services') services.factory("IntervalRefresh", [ "$interval", ($interval)-> - (refreshFunction,scope,refreshTimeout=30000)-> + (refreshFunction,scope,refreshTimeout=60000)-> refreshFunction() intervalPromise = $interval(refreshFunction, refreshTimeout) scope.$on("$destroy", -> $interval.cancel(intervalPromise))