Skip to content

Commit

Permalink
post: check if pid file exists before reading it
Browse files Browse the repository at this point in the history
  • Loading branch information
gmichelo committed May 8, 2023
1 parent 492baf4 commit 5878a2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2881,8 +2881,10 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const pid = external_fs_.readFileSync(ProxyPidFile, "utf8");
process.kill(parseInt(pid), "SIGINT");
if (external_fs_.existsSync(ProxyPidFile)) {
const pid = external_fs_.readFileSync(ProxyPidFile, "utf8");
process.kill(parseInt(pid), "SIGINT");
}
}
catch (error) {
core.setFailed(error.message);
Expand Down
6 changes: 4 additions & 2 deletions post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import { ProxyPidFile } from "./common";

async function run(): Promise<void> {
try {
const pid = fs.readFileSync(ProxyPidFile, "utf8");
process.kill(parseInt(pid), "SIGINT");
if (fs.existsSync(ProxyPidFile)) {
const pid = fs.readFileSync(ProxyPidFile, "utf8");
process.kill(parseInt(pid), "SIGINT");
}
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 5878a2c

Please sign in to comment.