From 5aee70243909bfb14772f3c24ccc707e6ce47ea1 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 19 Apr 2016 14:44:39 +0200 Subject: [PATCH] check system status when restarting server --- server/sonar-web/src/main/js/api/system.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } -- 2.39.5