mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[misc] let the orchestrator handle the process restart
Note that there is also the `shutdownCleanly` interval which may notice that the shutdown has completed. There is some network IO required to signal all clients the server disconnect, so we cannot run process.exit immediately.
This commit is contained in:
parent
ee59056c6e
commit
ea75b84eef
1 changed files with 12 additions and 1 deletions
|
@ -98,7 +98,16 @@ function healthCheck(req, res) {
|
|||
}
|
||||
})
|
||||
}
|
||||
app.get('/health_check', healthCheck)
|
||||
app.get(
|
||||
'/health_check',
|
||||
(req, res, next) => {
|
||||
if (Settings.shutDownComplete) {
|
||||
return res.sendStatus(503)
|
||||
}
|
||||
next()
|
||||
},
|
||||
healthCheck
|
||||
)
|
||||
|
||||
app.get('/health_check/redis', healthCheck)
|
||||
|
||||
|
@ -167,6 +176,8 @@ function drainAndShutdown(signal) {
|
|||
client.disconnect()
|
||||
})
|
||||
}
|
||||
// Mark the node as unhealthy.
|
||||
Settings.shutDownComplete = true
|
||||
}, Settings.gracefulReconnectTimeoutMs)
|
||||
})
|
||||
shutdownCleanly(signal)
|
||||
|
|
Loading…
Reference in a new issue