From 3c27970678e012943d1e42c5d1b6dd488e3f99ec Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 8 Feb 2023 10:22:24 +0100 Subject: [PATCH] Merge pull request #11532 from overleaf/tm-nginx-prestop-shutdown-delay Prevent dropbox webhook failures by gracefully shutting down web GitOrigin-RevId: 32c3a699c22402a5829ba2c8fe7c6ae829b08dbf --- services/web/app/src/router.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/router.js b/services/web/app/src/router.js index ba4d7706ae..5465d1b307 100644 --- a/services/web/app/src/router.js +++ b/services/web/app/src/router.js @@ -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)')