Skip to content

Commit

Permalink
Merge pull request #68 from snyk-tech-services/develop
Browse files Browse the repository at this point in the history
RELEASE
  • Loading branch information
lili2311 authored Aug 5, 2022
2 parents a5ebb1c + a1bf845 commit 618aea3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@snyk/configstore": "^3.2.0-rc1",
"@types/debug": "^4.1.7",
"@types/uuid": "^7.0.3",
"axios": "0.21.4",
"axios": "0.27.2",
"chalk": "^4.0.0",
"debug": "^4.1.1",
"global-agent": "3.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/lib/request/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const makeSnykRequest = async (
baseURL: request.useRESTApi ? apiUrlREST : apiUrl,
responseType: 'json',
headers: { ...requestHeaders, ...request.headers },
transitional: {
clarifyTimeoutError: true,
},
timeout: 30_000, // 5 mins same as Snyk APIs
});

try {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/request/requestManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ class RequestsManager {
requestId,
);
const alreadyRetriedCount = this._retryCounter.get(requestId) || 0;
if (alreadyRetriedCount >= this._MAX_RETRY_COUNT) {
if (
err?.name === 'NotFoundError' ||
alreadyRetriedCount >= this._MAX_RETRY_COUNT
) {
this._emit({
eventType: eventType.error,
channel: request.channel,
Expand Down

0 comments on commit 618aea3

Please sign in to comment.