Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CD937111CB for ; Mon, 16 Jun 2014 18:00:57 +0000 (UTC) Received: (qmail 56489 invoked by uid 500); 16 Jun 2014 18:00:57 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 56458 invoked by uid 500); 16 Jun 2014 18:00:57 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 56444 invoked by uid 99); 16 Jun 2014 18:00:57 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jun 2014 18:00:57 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 46E2B9407B0; Mon, 16 Jun 2014 18:00:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: alexantonenko@apache.org To: commits@ambari.apache.org Message-Id: <926d17dba2a749e09767bb71a12a0155@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-6140. Step3. Hosts checks requests (alexantonenko) Date: Mon, 16 Jun 2014 18:00:57 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 9d70900dd -> 6fdc34f12 AMBARI-6140. Step3. Hosts checks requests (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6fdc34f1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6fdc34f1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6fdc34f1 Branch: refs/heads/trunk Commit: 6fdc34f129755cca9f316d6d774c35b8c026d375 Parents: 9d70900 Author: Alex Antonenko Authored: Mon Jun 16 20:19:24 2014 +0300 Committer: Alex Antonenko Committed: Mon Jun 16 20:35:37 2014 +0300 ---------------------------------------------------------------------- .../app/controllers/wizard/step3_controller.js | 43 ++++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/6fdc34f1/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index 5e12f52..e7a62ef 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -36,6 +36,7 @@ App.WizardStep3Controller = Em.Controller.extend({ repoCategoryWarnings: [], diskCategoryWarnings: [], jdkCategoryWarnings: null, + jdkRequestIndex: null, registrationStartedAt: null, @@ -727,26 +728,22 @@ App.WizardStep3Controller = Em.Controller.extend({ }, doCheckJDKsuccessCallback: function (data) { - var requestIndex = data.href.split('/')[data.href.split('/').length - 1]; - var self = this; - // keep getting JDK check results data until all hosts jdk check completed - var myVar = setInterval( function(){ - if (self.get('jdkCategoryWarnings') == null) { - // get jdk check results for all hosts - App.ajax.send({ - name: 'wizard.step3.jdk_check.get_results', - sender: self, - data: { - requestIndex: requestIndex - }, - success: 'parseJDKCheckResults' - }) - } else { - clearInterval(myVar); - self.set('isJDKWarningsLoaded', true); - } - }, - 1000); + if(data){ + this.set('jdkRequestIndex', data.href.split('/')[data.href.split('/').length - 1]); + } + if (this.get('jdkCategoryWarnings') == null) { + // get jdk check results for all hosts + App.ajax.send({ + name: 'wizard.step3.jdk_check.get_results', + sender: this, + data: { + requestIndex: this.get('jdkRequestIndex') + }, + success: 'parseJDKCheckResults' + }) + } else { + this.set('isJDKWarningsLoaded', true); + } }, doCheckJDKerrorCallback: function () { console.log('INFO: Doing JDK check for host failed'); @@ -779,6 +776,7 @@ App.WizardStep3Controller = Em.Controller.extend({ // still doing JDK check, data not ready to be parsed this.set('jdkCategoryWarnings', null); } + this.doCheckJDKsuccessCallback(); }, /** @@ -871,9 +869,9 @@ App.WizardStep3Controller = Em.Controller.extend({ * @method getHostCheckTasks */ getHostCheckTasks: function () { - var requestId = this.get("requestId"); var self = this; - var checker = setInterval(function () { + var requestId = this.get("requestId"); + var checker = setTimeout(function () { if (self.get('stopChecking') == true) { clearInterval(checker); self.getHostInfo(); @@ -928,6 +926,7 @@ App.WizardStep3Controller = Em.Controller.extend({ this.set('stopChecking', false); } }, this); + this.getHostCheckTasks(); }, stopChecking: false,