Merge pull request #3426 from strapi/tech/handle-health-bad-status-code

Add status code handler to health checks
This commit is contained in:
Alexandre BODIN 2019-06-11 18:17:02 +02:00 committed by GitHub
commit 9d8025ed27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,10 @@ function serverRestartWatcher(response) {
'Keep-Alive': false,
},
})
.then(() => {
.then(res => {
if (res.status >= 400) {
throw new Error('not available');
}
// Hide the global OverlayBlocker
strapi.unlockApp();
resolve(response);