ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-4989 Request status shows 2% completed although only 1 out of 800 tasks is pending. (atkach)
Date Fri, 07 Mar 2014 13:23:57 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cab195ddb -> 7dc110d64


AMBARI-4989 Request status shows 2% completed although only 1 out of 800 tasks is pending.
(atkach)


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

Branch: refs/heads/trunk
Commit: 7dc110d646db956c839c457ec48486085adb4bdd
Parents: cab195d
Author: atkach <atkach@hortonworks.com>
Authored: Fri Mar 7 15:21:50 2014 +0200
Committer: atkach <atkach@hortonworks.com>
Committed: Fri Mar 7 15:21:50 2014 +0200

----------------------------------------------------------------------
 .../global/background_operations_controller.js      | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7dc110d6/ambari-web/app/controllers/global/background_operations_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/background_operations_controller.js b/ambari-web/app/controllers/global/background_operations_controller.js
index 76aa10e..9dee2c0 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -129,6 +129,16 @@ App.BackgroundOperationsController = Em.Controller.extend({
       }
       currentTaskStatusMap[task.Tasks.id] = task.Tasks.status;
     }, this);
+    /**
+     * sync up request progress with up to date progress of hosts on Host's list,
+     * to avoid discrepancies while waiting for response with latest progress of request
+     * after switching to operation's list
+     */
+    if (request.get('isRunning')) {
+      request.set('progress', App.HostPopup.getProgress(data.tasks));
+      request.set('status', App.HostPopup.getStatus(data.tasks)[0]);
+      request.set('isRunning', (request.get('progress') !== 100));
+    }
     request.set('previousTaskStatusMap', currentTaskStatusMap);
     request.set('hostsMap', hostsMap);
     this.set('serviceTimestamp', App.dateTime());
@@ -167,12 +177,12 @@ App.BackgroundOperationsController = Em.Controller.extend({
       var inputs = null;
       if (request.Requests.inputs) {
         inputs = JSON.parse(request.Requests.inputs);
-      };
+      }
       var oneHost = false;
       if (inputs && inputs.included_hosts) {
         var hosts = inputs.included_hosts.split(',');
-        oneHost = hosts.length < 2 ? true : false;
-      };
+        oneHost = (hosts.length < 2);
+      }
       if(request.Requests.request_schedule && oneHost && /Recommission/.test(requestParams.requestContext)){
         request.Requests.request_schedule.schedule_id = null;
       }


Mime
View raw message