mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Implement a lifecycle hook for queue processor so it can shut down gracefully
This commit is contained in:
parent
f03b7182b3
commit
0e9e331e18
1 changed files with 6 additions and 0 deletions
|
|
@ -142,6 +142,12 @@ const main = async () => {
|
|||
// respond healthy to auto-scaler.
|
||||
app.get('/_ah/health', (req, res) => res.sendStatus(200))
|
||||
|
||||
app.get('/lifecyle/prestop', async (req, res) => {
|
||||
logger.info('prestop lifecycle hook called.')
|
||||
await worker.close()
|
||||
res.sendStatus(200)
|
||||
})
|
||||
|
||||
app.get('/metrics', async (_, res) => {
|
||||
const queue = await getBackendQueue()
|
||||
if (!queue) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue