@vitrical/utils
Advanced tools
Comparing version 1.6.4 to 1.6.5
14
api.js
@@ -8,2 +8,16 @@ "use strict"; | ||
const axios_1 = __importDefault(require("axios")); | ||
const axios_retry_1 = __importDefault(require("axios-retry")); | ||
(0, axios_retry_1.default)(axios_1.default, { | ||
retries: 3, | ||
retryDelay: (retryCount) => { | ||
console.log(`retry attempt: ${retryCount}`); | ||
return retryCount * 2000; | ||
}, | ||
retryCondition: (error) => { | ||
if (!error.response) { | ||
return false; | ||
} | ||
return error.response.status === 503; | ||
}, | ||
}); | ||
function isFetchAvailable() { | ||
@@ -10,0 +24,0 @@ return typeof fetch !== 'undefined'; |
{ | ||
"name": "@vitrical/utils", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "Collection of useful functions and typings", | ||
@@ -26,2 +26,3 @@ "main": "index.js", | ||
"axios": "^1.6.5", | ||
"axios-retry": "^4.4.0", | ||
"jsonwebtoken": "^9.0.2", | ||
@@ -28,0 +29,0 @@ "typescript": "^4.9.4" |
Sorry, the diff of this file is not supported yet
51073
771
6
+ Addedaxios-retry@^4.4.0
+ Addedaxios-retry@4.4.1(transitive)
+ Addedis-retry-allowed@2.2.0(transitive)