process.on('SIGINT', () => { watcher.close(); flowServer.kill(); console.log(CLEARLINE + yellow(invert('stopped watching'))); process.exit(); });
function prepareProcess(name, disposeCallback) { process.title = 'ndb/' + name; function silentRpcErrors(error) { if (!process.connected && error.code === 'ERR_IPC_CHANNEL_CLOSED') return; throw error; } process.on('uncaughtException', silentRpcErrors); process.on('unhandledRejection', silentRpcErrors); // dispose when child process is disconnected process.on('disconnect', () => disposeCallback()); }
stopSignals.forEach(function (signal) { process.on(signal, function () { console.log(`Got ${signal}, stopping workers...`); stopping = true; cluster.disconnect(function () { console.log("All workers stopped, exiting."); process.exit(0); }); }); });
process.on("message", msg => { msg = JSON.parse(msg); si[msg.type](msg.arg).then(res => { process.send(JSON.stringify({ id: msg.id, res })); }); });
initDockerConnection() .then(initScreens) .then(function (screen) { process.on('uncaughtException', (err) => { // Make sure the screen is cleared screen.teardown() exitError(err) }) }) .catch((err) => { return exitError(err) })
process.on('unhandledRejection', error => { if (error.message.includes('Protocol error') && error.message.includes('Target closed')) process.exit(1); console.log('unhandledRejection', error.stack || error.message); });
process.on("message", msg => { if (msg.cmd == "start") { start(msg); } });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
process.on("message", msg => { msg = JSON.parse(msg); si[msg.type](msg.arg).then(res => { process.send(JSON.stringify({ id: msg.id, res })); }); });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
// Makes the script crash on unhandled rejections instead of silently // ignoring them. In the future, promise rejections that are not handled will // terminate the Node.js process with a non-zero exit code. process.on('unhandledRejection', err => { throw err; });
stopSignals.forEach(function (signal) { process.on(signal, function () { console.log(`Got ${signal}, stopping workers...`); stopping = true; cluster.disconnect(function () { console.log("All workers stopped, exiting."); process.exit(0); }); }); });