File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/js/modules/admin/controllers Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ define(['./_module'], function (app) {
8383 }
8484
8585 var scavengeQuery = { } ;
86+ var timeout ;
8687 function setupScavengeStatusPoller ( ) {
8788 scavengeQuery = poller . create ( {
8889 interval : constants . scavengeStatus . pollInterval ,
@@ -93,7 +94,11 @@ define(['./_module'], function (app) {
9394
9495 scavengeQuery . promise . then ( null ,
9596 function ( ) {
96- $timeout ( function ( ) {
97+ if ( timeout ) {
98+ $timeout . cancel ( timeout ) ;
99+ timeout = null ;
100+ }
101+ timeout = $timeout ( function ( ) {
97102 setupScavengeStatusPoller ( ) ;
98103 } , constants . scavengeStatus . pollInterval ) ;
99104 } , getScavengeHistory ) ;
@@ -102,6 +107,10 @@ define(['./_module'], function (app) {
102107 setupScavengeStatusPoller ( ) ;
103108
104109 $scope . $on ( '$destroy' , function ( ) {
110+ if ( timeout ) {
111+ $timeout . cancel ( timeout ) ;
112+ timeout = null ;
113+ }
105114 scavengeQuery . stop ( ) ;
106115 } ) ;
107116 }
You can’t perform that action at this time.
0 commit comments