diff --git a/package.json b/package.json index 5f4ba8b..bc16e3e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/lib/request/request.ts b/src/lib/request/request.ts index 4429f69..1ab7bfe 100644 --- a/src/lib/request/request.ts +++ b/src/lib/request/request.ts @@ -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 { diff --git a/src/lib/request/requestManager.ts b/src/lib/request/requestManager.ts index 7645d6e..64033a4 100644 --- a/src/lib/request/requestManager.ts +++ b/src/lib/request/requestManager.ts @@ -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,