Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Handle delivery of multiple SIGINT signals without exiting
Signed-off-by: Ben Weintraub <ben.weintraub@nytimes.com>
  • Loading branch information
benweint committed Dec 17, 2023
commit c023d04802e489b483fdbf8b39de1ba42067489d
6 changes: 5 additions & 1 deletion nf.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ var calculatePadding = _requirements.calculatePadding;
var startProxies = require('./lib/proxy').startProxies;
var startForward = require('./lib/forward').startForward;

var interrupted = false;

// Kill All Child Processes on SIGINT
process.once('SIGINT', function() {
process.on('SIGINT', function() {
if (interrupted) return;
interrupted = true;
display.Warn('Interrupted by User');
emitter.emit('killall', 'SIGINT');
});
Expand Down