Updated Branches:
  refs/heads/trunk 94ee80d7b -> 06c840fa6

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


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/06c840fa
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/06c840fa
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/06c840fa

Branch: refs/heads/trunk
Commit: 06c840fa675db183a0616fb4fb808a7293c1e13a
Parents: 94ee80d
Author: Yusaku Sako <[email protected]>
Authored: Thu Jul 11 11:29:26 2013 -0700
Committer: Yusaku Sako <[email protected]>
Committed: Thu Jul 11 11:29:26 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/utils/polling.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/06c840fa/ambari-web/app/utils/polling.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/polling.js b/ambari-web/app/utils/polling.js
index a0a84f6..717b819 100644
--- a/ambari-web/app/utils/polling.js
+++ b/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) {

Reply via email to