Skip to content

Commit

Permalink
Merge pull request #273 from robertlestak/master
Browse files Browse the repository at this point in the history
ON_DEATH process.exit with int exit code
  • Loading branch information
pabloromeo authored Jan 13, 2024
2 parents aa8e7f4 + 5caba57 commit aa0e0c5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
17 changes: 16 additions & 1 deletion orchestrator/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,20 @@ server.listen(LISTENING_PORT, () => {
ON_DEATH((signal, err) => {
console.log("ON_DEATH signal detected");
console.error(err);
process.exit(signal);
let exitCode = 0;
switch (signal) {
case "SIGINT":
exitCode = 130;
break;
case "SIGQUIT":
exitCode = 131;
break;
case "SIGTERM":
exitCode = 143;
break;
default:
exitCode = 1;
break;
}
process.exit(exitCode);
});
17 changes: 16 additions & 1 deletion pms/app/transcoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,20 @@ ON_DEATH((signal, err) => {
console.log("Killing child transcoder");
child.kill();
}
process.exit(signal);
let exitCode = 0;
switch (signal) {
case "SIGINT":
exitCode = 130;
break;
case "SIGQUIT":
exitCode = 131;
break;
case "SIGTERM":
exitCode = 143;
break;
default:
exitCode = 1;
break;
}
process.exit(exitCode);
});
17 changes: 16 additions & 1 deletion worker/app/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,22 @@ ON_DEATH((signal, err) => {
console.log("ON_DEATH signal detected");
console.error(err);
deleteEAE_PID();
process.exit(signal);
let exitCode = 0;
switch (signal) {
case "SIGINT":
exitCode = 130;
break;
case "SIGQUIT":
exitCode = 131;
break;
case "SIGTERM":
exitCode = 143;
break;
default:
exitCode = 1;
break;
}
process.exit(exitCode);
});

function deleteEAE_PID() {
Expand Down

0 comments on commit aa0e0c5

Please sign in to comment.