Skip to content

Commit

Permalink
Merge pull request #86 from manipalutsav/manipalutsav-svc-patch-1
Browse files Browse the repository at this point in the history
Update restart.js
  • Loading branch information
r21meghashyam authored Feb 27, 2024
2 parents f86981b + ac91cf2 commit deba963
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 deba963

Please sign in to comment.