Fix update test, a 409 indicates an update is already in progress
This commit is contained in:
parent
0485323ffb
commit
e0242d003c
@ -178,7 +178,7 @@ Cloudron.prototype.uninstallApp = function (appId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
debug('App is uninstalled'.green);
|
debug('App is uninstalled'.green);
|
||||||
}
|
};
|
||||||
|
|
||||||
Cloudron.prototype.update = function (toVersion) {
|
Cloudron.prototype.update = function (toVersion) {
|
||||||
process.stdout.write('Trying to update');
|
process.stdout.write('Trying to update');
|
||||||
@ -188,6 +188,7 @@ Cloudron.prototype.update = function (toVersion) {
|
|||||||
process.stdout.write('.');
|
process.stdout.write('.');
|
||||||
res = request.post(this._origin + '/api/v1/cloudron/update').query({ access_token: this._credentials.accessToken }).send({ password: this._credentials.password }).end();
|
res = request.post(this._origin + '/api/v1/cloudron/update').query({ access_token: this._credentials.accessToken }).send({ password: this._credentials.password }).end();
|
||||||
if (res.statusCode === 422) continue; // box has not seen the update yet
|
if (res.statusCode === 422) continue; // box has not seen the update yet
|
||||||
|
if (res.statusCode === 409) break; // update is in progress, lock was acquired
|
||||||
verifyResponse(res, 'Could not update');
|
verifyResponse(res, 'Could not update');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user