Skip to content

Commit

Permalink
Merge pull request #38 from step-security/timeout
Browse files Browse the repository at this point in the history
Timeout if API not reachable
  • Loading branch information
varunsh-coder authored Dec 15, 2021
2 parents 99f91e6 + 4869a8e commit dc71e89
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 7 additions & 1 deletion dist/pre/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pre/index.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ import * as tc from "@actions/tool-cache";
var web_url = "https://app.stepsecurity.io";

let _http = new httpm.HttpClient();
await _http.get(
`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`
);
_http.requestOptions = { socketTimeout: 3 * 1000 };
try {
await _http.get(
`${api_url}/github/${process.env["GITHUB_REPOSITORY"]}/actions/runs/${process.env["GITHUB_RUN_ID"]}/monitor`
);
} catch (e) {
console.log(`error in connecting to ${api_url}: ${e}`);
}

const confg = {
repo: process.env["GITHUB_REPOSITORY"],
Expand Down

0 comments on commit dc71e89

Please sign in to comment.