فهرست منبع

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

Yusaku Sako 12 سال پیش
والد
کامیت
06c840fa67
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  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) {