]> source.dussan.org Git - sonarqube.git/commitdiff
check system status when restarting server
authorStas Vilchik <vilchiks@gmail.com>
Tue, 19 Apr 2016 12:44:39 +0000 (14:44 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 19 Apr 2016 12:44:39 +0000 (14:44 +0200)
server/sonar-web/src/main/js/api/system.js

index 25b52880f9beedbb1fe06db4fe0698efa0492a9d..a280b6f7b7370a642d80f62a5121438d1a0c404a 100644 (file)
@@ -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);
 }