diff --git a/lib/web/middleware/tooBusy.js b/lib/web/middleware/tooBusy.js index a2101975..72020eda 100644 --- a/lib/web/middleware/tooBusy.js +++ b/lib/web/middleware/tooBusy.js @@ -8,6 +8,11 @@ const config = require('../../config') toobusy.maxLag(config.tooBusyLag) module.exports = function (req, res, next) { + // We dont want to return "toobusy" errors for healthchecks, as that + // will cause the process to be restarted + if (req.baseUrl === '/_health') { + next() + } if (toobusy()) { errors.errorServiceUnavailable(res) } else {