mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-04 21:23:31 +00:00
reject connections when shutdown in progress
send a message to the client to reconnect immediately
This commit is contained in:
parent
53431953fc
commit
0708f717fd
1 changed files with 5 additions and 0 deletions
|
@ -39,6 +39,11 @@ module.exports = Router =
|
|||
app.post "/drain", httpAuth, HttpApiController.startDrain
|
||||
|
||||
session.on 'connection', (error, client, session) ->
|
||||
if settings.shutDownInProgress
|
||||
client.emit("connectionRejected", {message: "retry"})
|
||||
client.disconnect()
|
||||
return
|
||||
|
||||
if client? and error?.message?.match(/could not look up session by key/)
|
||||
logger.warn err: error, client: client?, session: session?, "invalid session"
|
||||
# tell the client to reauthenticate if it has an invalid session key
|
||||
|
|
Loading…
Reference in a new issue