Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// "jest" we use this proxy script.
//
// We forward all arguments and stdio streams to the real "jest" program and exit with the same
// signal or status code.
//
// If you need to run Jest with the JS debugger enabled, run Jest directly. It is usually under
// node_modules/jest/bin/jest.js.
const jestPackageJson = require('jest/package.json');
const jestPackagePath = path.resolve(require.resolve('jest/package.json'), '..');
const jestProgramPath = path.resolve(jestPackagePath, jestPackageJson.bin.jest);
const jestProgramArgs = process.argv.slice(2);
const jestWithArgs = [jestProgramPath].concat(jestProgramArgs);
const result = childProcess.spawnSync('node', jestWithArgs, { stdio: 'inherit' });
if (result.signal) {
process.kill(process.pid, result.signal);
} else {
process.exit(result.status);
}
psTree(parentId, function (err, children) {
if (err) {
reject(err);
return;
}
children.forEach(item => {
try {
process.kill(item.PID);
} catch (ex) {
// Nothing
}
});
try {
process.kill(parentId);
} catch (ex) {
// Nothing
}
resolve();
});
});
r.table('tasks').get(id).run(conn, (err, task) => {
if (!err) {
/* verify the task isnt finished and kill process */
if (!task.terminated) {
process.kill(task.pid)
}
}
})
res.json({ success: true })
await new Promise((resolve) =>
{
worker.on('died', resolve);
process.kill(worker.pid, 'SIGKILL');
});
await new Promise((resolve, reject) =>
{
worker.on('died', reject);
process.kill(worker.pid, 'SIGPIPE');
process.kill(worker.pid, 'SIGHUP');
process.kill(worker.pid, 'SIGALRM');
process.kill(worker.pid, 'SIGUSR1');
process.kill(worker.pid, 'SIGUSR2');
setTimeout(() =>
{
expect(worker.closed).toBe(false);
worker.close();
resolve();
}, 2000);
});
}, 3000);
killProcess(pid) {
this.emit('will-kill-process', pid, this.window);
process.kill(pid);
this.emit('killed-process', pid, this.window);
}
function _spawnSubprocess(...args) {
let result = spawnSync(...args);
if (result.signal) {
process.kill(process.pid, result.signal);
}
if (result.status) {
process.exit(result.status);
}
}
export function stop(): void
{
if(fs.existsSync(System.PID_FILE_PATH))
{
let daemonPid: number = Number(fs.readFileSync(System.PID_FILE_PATH).toString());
try
{
process.kill(daemonPid, "SIGINT");
fs.unlinkSync(System.XLOCK_FILE);
}
catch (error)
{
fs.writeFileSync(System.LOGFILE_PATH_DAEMON, "Error at stop daemon, error: " + error + "\n", { flag: "a" });
}
fs.unlinkSync(System.PID_FILE_PATH);
setAutoFanDuty(5);
}
}
harbourDebugSession.prototype.terminateRequest = function(response, args)
{
process.kill(this.processId,'SIGKILL');
this.sendResponse(response);
}