Repository: ambari Updated Branches: refs/heads/branch-2.6 81b693a67 -> 6dd0feb20
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-2.6 Commit: 6dd0feb20d6a6a8afff708aaf026e0be54804835 Parents: 81b693a Author: Andrii Tkach <[email protected]> Authored: Fri Aug 18 13:23:14 2017 +0300 Committer: Andrii Tkach <[email protected]> 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', '<hdfs-user>'); + } dfd.resolve(); - clearInterval(interval); + miscController.destroy(); } - }, 10); + }); return dfd.promise(); },
