From 40d044c8fdbcf436207a4d2a09a5edb16f8f2f2d Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 4 Jul 2016 13:27:37 +0200 Subject: [PATCH] Do not immedately error if app still redirects --- cloudron.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudron.js b/cloudron.js index 8ef3a1f..0792c68 100644 --- a/cloudron.js +++ b/cloudron.js @@ -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') {