Browse Source

AMBARI-2628. "Start Services" process bar freeze after page refreshing on "Stop Services" phase. (Aleksandr Kovalenko via yusaku)

Yusaku Sako 12 năm trước cách đây
mục cha
commit
06c840fa67
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      ambari-web/app/utils/polling.js

+ 6 - 1
ambari-web/app/utils/polling.js

@@ -61,6 +61,7 @@ App.Poll = Em.Object.extend({
   setRequestId: function () {
     if (App.testMode) {
       this.set('requestId', '1');
+      this.doPolling();
       return;
     }
     var self = this;
@@ -86,6 +87,7 @@ App.Poll = Em.Object.extend({
         } else {
           var requestId = jsonData.Requests.id;
           self.set('requestId', requestId);
+          self.doPolling();
           console.log('requestId is: ' + requestId);
         }
       },
@@ -104,9 +106,12 @@ App.Poll = Em.Object.extend({
     if (this.get('requestId')) {
       this.startPolling();
     }
-  }.observes('requestId'),
+  },
 
   startPolling: function () {
+    if (!this.get('requestId')) {
+      return;
+    }
     var self = this;
     var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/requests/' + this.get('requestId') + '?fields=tasks/*';
     if (App.testMode) {