Skip to content
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.

Commit

Permalink
remove refresh from the failed page (#70)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davetron5000 authored Jan 20, 2017
1 parent 245d6d4 commit 89c02d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions app/assets/javascripts/controllers/FailedController.coffee
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -138,7 +138,5 @@ controllers.controller("FailedController", [
$scope.currentPage = parseInt($routeParams.page or "1")

$scope.refresh = loadFailedJobs
IntervalRefresh($scope.refresh,$scope)


loadFailedJobs()
])
2 changes: 1 addition & 1 deletion app/assets/javascripts/services/IntervalRefresh.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 89c02d7

Please sign in to comment.