Thanks to visit codestin.com
Credit goes to github.com

Skip to content

SIGINT handlers defined in app are not executed #192

@alexandervain

Description

@alexandervain

Operating System

  • MacOS
  • Linux

NodeJS Version

  • 10.15.3

Tmp Version

  • 0.1.0

Expected Behavior

Allow executing app defined SIGINT handlers

Experienced Behavior

App exits before custom handlers are executed.

Here is the reason: https://github.com/raszi/node-tmp/blob/master/lib/tmp.js#L635
Code to reproduce:

const tmp = require('tmp');
console.log(`Run from terminal: kill -SIGINT ${process.pid}`);

process.on('SIGINT', () => {
    console.log('Custom SIGINT handler - do some clean up')
    process.exit(0);
});

setTimeout(() => {}, 100000)

Custom SIGINT handler - do some clean up not printed.

The same code works OK with [email protected]

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions