0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00

refactor: graceful shutdown using process.once() instead of process.on() (#2737)

This commit is contained in:
darkgl0w 2021-12-07 17:58:34 +01:00 committed by GitHub
parent d04153a8e5
commit 9430e9fc0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,9 +150,10 @@ export async function initServer(
}); });
} }
process.on('SIGINT', handleShutdownGracefully); for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
process.on('SIGTERM', handleShutdownGracefully); // Use once() so that receiving double signals exit the app.
process.on('SIGHUP', handleShutdownGracefully); process.once(signal, handleShutdownGracefully);
}
}); });
} }