#Graceful shutdown timeout?

3 messages · Page 1 of 1 (latest)

gilded fiber
#

Is there a way to specify a timeout for the graceful shutdown? I don't want the service to wait longer than 30 seconds on long-running requests.

visual wharf
#

There’s app.enableShutdownHooks that should make your app stop properly when running inside docker.

austere orbit
#

I don't think the timeout is configurable, but you can do something like this to forcefully stop the app after certain amount of time after the shutdown signal:

process.on('SIGINT',
  () => setTimeout(() => process.exit(1), 30_000)
)