mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
do not close redis connection
This commit is contained in:
parent
846d1e3381
commit
a6d7623cea
1 changed files with 3 additions and 14 deletions
|
|
@ -24,17 +24,6 @@ redis.on('error', (err) => {
|
|||
console.error('Redis error', err)
|
||||
})
|
||||
|
||||
export const gracefulShutdown = async (signal: string) => {
|
||||
console.log(`Received ${signal}, closing server...`)
|
||||
try {
|
||||
await redis.quit()
|
||||
console.log('Redis connection closed')
|
||||
} catch (error) {
|
||||
console.error('Error while shutting down redis', error)
|
||||
} finally {
|
||||
process.exit(0)
|
||||
}
|
||||
}
|
||||
|
||||
process.on('SIGINT', () => gracefulShutdown('SIGINT'))
|
||||
process.on('SIGTERM', () => gracefulShutdown('SIGTERM'))
|
||||
redis.on('close', () => {
|
||||
console.log('Redis closed')
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue