pass the signal correctly to the shutdown handler

This commit is contained in:
Brian Gough 2020-02-04 11:14:53 +00:00
parent 1fc8cc44c3
commit e263d37476

View file

@ -135,8 +135,7 @@ if Settings.shutdownDrainTimeWindow?
shutdownDrainTimeWindow = parseInt(Settings.shutdownDrainTimeWindow, 10) shutdownDrainTimeWindow = parseInt(Settings.shutdownDrainTimeWindow, 10)
logger.log shutdownDrainTimeWindow: shutdownDrainTimeWindow,"shutdownDrainTimeWindow enabled" logger.log shutdownDrainTimeWindow: shutdownDrainTimeWindow,"shutdownDrainTimeWindow enabled"
for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT'] for signal in ['SIGINT', 'SIGHUP', 'SIGQUIT', 'SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGABRT']
process.on signal, -> process.on signal, drainAndShutdown # signal is passed as argument to event handler
drainAndShutdown(signal)
# global exception handler # global exception handler
if Settings.errors?.catchUncaughtErrors if Settings.errors?.catchUncaughtErrors