Gracefully handle preview-service shutdown

This commit is contained in:
Iain Sproat
2025-04-11 13:33:30 +01:00
parent 188518dd8c
commit 66f3f6ff74
+2
View File
@@ -131,6 +131,8 @@ const server = app.listen(port, host, async () => {
logger.error({ err }, 'Error creating job queue')
// the callback to server.listen has failed, so we need to exit the process and not just return
await beforeShutdown() // handle the shutdown gracefully
await onShutdown()
process.exit(1)
}