Do not immedately error if app still redirects

This commit is contained in:
Johannes Zellner 2016-07-04 13:27:37 +02:00
parent 88dc83c237
commit 40d044c8fd
1 changed files with 4 additions and 0 deletions

View File

@ -135,6 +135,10 @@ Cloudron.prototype.waitForApp = function (appId, version) {
sleep(30);
process.stdout.write('.');
res = request.get(this._origin + '/api/v1/apps/'+ appId).query({ access_token: this._credentials.accessToken }).end();
// if app still redirects, wait a bit
if (res.statusCode === 307) continue;
common.verifyResponse2xx(res, 'Could not query app status');
if (res.body.installationState === 'installed' && res.body.runState === 'running' && res.body.health === 'healthy') {