motion
Version:
motion - moving development forward
35 lines (27 loc) • 620 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.now = now;
exports.setChild = setChild;
// STOP
process.on('SIGINT', cleanExit);
process.on('SIGTERM', cleanExit);
process.on('uncaughtException', cleanExit);
let child;
function cleanExit(e) {
if (e) console.log(e.stack);
child && child.send('EXIT'); // this seems to be required
setTimeout(() => {
child && child.kill('SIGINT');
process.exit(0);
});
}
function now() {
cleanExit();
}
function setChild(_child) {
child = _child;
}
exports.default = { now, setChild };
//# sourceMappingURL=shutdown.js.map
;