Skip to content

Commit

Permalink
Update restart.js
Browse files Browse the repository at this point in the history
  • Loading branch information
manipalutsav-svc authored Feb 27, 2024
1 parent ded1359 commit ac91cf2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/restart.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ pm2.connect(async (err) => {
console.log("Stopping it.")
console.log(child_process.execSync("pm2 stop " + pm2_id).toString());
console.log("Terminating process " + pid);
try{
console.log(child_process.execSync("sudo kill " + pid).toString());
}
catch(e){
console.log("Failed to terminate process, reason:",e);
}
}
console.log("Restarting pm2 instance " + pm2_id);
console.log(child_process.execSync("pm2 start " + pm2_id).toString());
Expand All @@ -41,4 +46,4 @@ pm2.connect(async (err) => {
console.error("ERROR", e);
process.exit(-1);
}
})
})

0 comments on commit ac91cf2

Please sign in to comment.