From: Stas Vilchik Date: Tue, 19 Apr 2016 12:44:39 +0000 (+0200) Subject: check system status when restarting server X-Git-Tag: 5.6-RC1~260 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5aee70243909bfb14772f3c24ccc707e6ce47ea1;p=sonarqube.git check system status when restarting server --- diff --git a/server/sonar-web/src/main/js/api/system.js b/server/sonar-web/src/main/js/api/system.js index 25b52880f9b..a280b6f7b73 100644 --- a/server/sonar-web/src/main/js/api/system.js +++ b/server/sonar-web/src/main/js/api/system.js @@ -45,7 +45,13 @@ const POLLING_INTERVAL = 2000; function pollStatus (cb) { setTimeout(() => { getStatus() - .then(() => cb()) + .then(r => { + if (r.status === 'UP') { + cb(); + } else { + pollStatus(cb); + } + }) .catch(() => pollStatus(cb)); }, POLLING_INTERVAL); }