Merge pull request #11532 from overleaf/tm-nginx-prestop-shutdown-delay

Prevent dropbox webhook failures by gracefully shutting down web

GitOrigin-RevId: 32c3a699c22402a5829ba2c8fe7c6ae829b08dbf
This commit is contained in:
Thomas 2023-02-08 10:22:24 +01:00 committed by Copybot
parent c7d3cb0561
commit 3c27970678

View file

@ -1212,7 +1212,9 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
})
publicApiRouter.get('/status', (req, res) => {
if (!Settings.siteIsOpen) {
if (Settings.shuttingDown) {
res.sendStatus(503) // Service unavailable
} else if (!Settings.siteIsOpen) {
plainTextResponse(res, 'web site is closed (web)')
} else if (!Settings.editorIsOpen) {
plainTextResponse(res, 'web editor is closed (web)')