Skip to content

Commit c3f4264

Browse files
authored
Suppress ESRCH errors when killing job process. Closes #1209 (#1210)
1 parent ed4249d commit c3f4264

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plugins/GenerateJob/templates/start.ejs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@ requirejs([
219219
pid = job.pid;
220220
job = null;
221221
log(`killing process group: ${pid}`);
222-
process.kill(-pid, 'SIGTERM');
222+
try {
223+
process.kill(-pid, 'SIGTERM');
224+
} catch (err) {
225+
if (!err.message.includes('ESRCH')) {
226+
log('Error while killing process group: ' + err.message);
227+
}
228+
}
223229
}
224230
if (exitCode !== undefined) {
225231
if (exitCode !== null) {

0 commit comments

Comments
 (0)