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
@@ -98,11 +98,13 @@ const AdminController = {
return res.render('admin/register')
},
dissconectAllUsers: (req, res) => {
disconnectAllUsers: (req, res) => {
logger.warn('disconecting everyone')
const delay = (req.query && req.query.delay) > 0 ? req.query.delay : 10
EditorRealTimeController.emitToAll(
'forceDisconnect',
'Sorry, we are performing a quick update to the editor and need to close it down. Please refresh the page to continue.'
'Sorry, we are performing a quick update to the editor and need to close it down. Please refresh the page to continue.',
delay
)
return res.sendStatus(200)
},