瀏覽代碼

Merge branch 'v4.4.x'

Torkel Ödegaard 8 年之前
父節點
當前提交
1a53d6453b
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      public/app/features/dashboard/time_srv.ts

+ 3 - 5
public/app/features/dashboard/time_srv.ts

@@ -116,16 +116,14 @@ class TimeSrv {
 
   setAutoRefresh(interval) {
     this.dashboard.refresh = interval;
+    this.cancelNextRefresh();
     if (interval) {
       var intervalMs = kbn.interval_to_ms(interval);
 
-      this.$timeout(() => {
+      this.refreshTimer = this.timer.register(this.$timeout(() => {
         this.startNextRefreshTimer(intervalMs);
         this.refreshDashboard();
-      }, intervalMs);
-
-    } else {
-      this.cancelNextRefresh();
+      }, intervalMs));
     }
 
     // update url