浏览代码

HUE-5819 [editor] Check status frequency should slow down with time

Romain Rigaux 8 年之前
父节点
当前提交
75ca82a2c7
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 2 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1393,7 +1393,8 @@ var EditorViewModel = (function() {
 
             if (self.status() == 'running' || self.status() == 'starting' || self.status() == 'waiting') {
               self.result.endTime(new Date());
-              if (! notebook.unloaded()) { self.checkStatusTimeout = setTimeout(self.checkStatus, 1000); };
+              var delay = self.result.executionTime() > 120000 ? 5000 : 1000; // 5s if more than 2min
+              if (! notebook.unloaded()) { self.checkStatusTimeout = setTimeout(self.checkStatus, delay); };
             }
             else if (self.status() == 'available') {
               self.fetchResult(100);