浏览代码

Merge pull request #4220 from mtanda/issue_1419

Align auto refresh interval
Torkel Ödegaard 9 年之前
父节点
当前提交
eb4a46b40f
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      public/app/features/dashboard/timeSrv.js

+ 5 - 1
public/app/features/dashboard/timeSrv.js

@@ -69,7 +69,11 @@ define([
       this.dashboard.refresh = interval;
       if (interval) {
         var _i = kbn.interval_to_ms(interval);
-        this.start_scheduled_refresh(_i);
+        var wait_ms = _i - (Date.now() % _i);
+        $timeout(function () {
+          self.start_scheduled_refresh(_i);
+          self.refreshDashboard();
+        }, wait_ms);
       } else {
         this.cancel_scheduled_refresh();
       }