Merge pull request #3682 from overleaf/bg-check-maintenance-file

check maintenance file periodically to close site

GitOrigin-RevId: 8e29f40a23df96198c6e4603ede2bab852b98740
This commit is contained in:
Brian Gough
2021-02-25 10:49:24 +00:00
committed by Copybot
parent 54212385e6
commit bc4f5a687a
6 changed files with 35 additions and 19 deletions
@@ -10,8 +10,14 @@ const {
module.exports = {
check(req, res, next) {
// detach from express for cleaner stack traces
setTimeout(() => runSmokeTestsDetached(req, res).catch(next))
if (!settings.siteIsOpen || !settings.editorIsOpen) {
// always return successful health checks when site is closed
res.contentType('application/json')
res.sendStatus(200)
} else {
// detach from express for cleaner stack traces
setTimeout(() => runSmokeTestsDetached(req, res).catch(next))
}
},
checkActiveHandles(req, res, next) {