ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [3/5] ambari git commit: AMBARI-21754 /v1/persist API call is made 1000 times per minute after Ambari upgrade. (atkach)
Date Fri, 18 Aug 2017 19:37:08 GMT
AMBARI-21754 /v1/persist API call is made 1000 times per minute after Ambari upgrade. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-21450
Commit: 6dd0feb20d6a6a8afff708aaf026e0be54804835
Parents: 81b693a
Author: Andrii Tkach <atkach@apache.org>
Authored: Fri Aug 18 13:23:14 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Fri Aug 18 13:51:16 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6dd0feb2/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index e8303f3..8569701 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -364,13 +364,17 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
     var dfd = $.Deferred();
     var miscController = App.MainAdminServiceAccountsController.create();
     miscController.loadUsers();
-    var interval = setInterval(function () {
+    miscController.addObserver('dataIsLoaded', this, function() {
       if (miscController.get('dataIsLoaded') && miscController.get('users')) {
-        self.set('hdfsUser', miscController.get('users').findProperty('name', 'hdfs_user').get('value'));
+        if (miscController.get('users').someProperty('name', 'hdfs_user')) {
+          self.set('hdfsUser', miscController.get('users').findProperty('name', 'hdfs_user').get('value'));
+        } else {
+          self.set('hdfsUser', '&lt;hdfs-user&gt;');
+        }
         dfd.resolve();
-        clearInterval(interval);
+        miscController.destroy();
       }
-    }, 10);
+    });
     return dfd.promise();
   },
 


Mime
View raw message