mappersmith
Advanced tools
Comparing version 2.15.0 to 2.15.1
@@ -18,3 +18,3 @@ 'use strict'; | ||
/* global VERSION */ | ||
var version = exports.version = '2.15.0'; | ||
var version = exports.version = '2.15.1'; | ||
@@ -21,0 +21,0 @@ var configs = exports.configs = { |
@@ -22,4 +22,4 @@ 'use strict'; | ||
retries: 5, // max retries | ||
validateRetry: function validateRetry() { | ||
return true; | ||
validateRetry: function validateRetry(response) { | ||
return response.responseStatus >= 500; | ||
} // a function that returns true if the request should be retried | ||
@@ -26,0 +26,0 @@ |
{ | ||
"name": "mappersmith", | ||
"version": "2.15.0", | ||
"version": "2.15.1", | ||
"description": "It is a lightweight rest client for node.js and the browser", | ||
@@ -5,0 +5,0 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>", |
@@ -577,3 +577,3 @@ [![npm version](https://badge.fury.io/js/mappersmith.svg)](http://badge.fury.io/js/mappersmith) | ||
This middleware will automatically retry GET requests up to the configured amount of retries using a randomization function that grows exponentially. The retry count and the time used will be included as a header in the response. | ||
This middleware will automatically retry GET requests up to the configured amount of retries using a randomization function that grows exponentially. The retry count and the time used will be included as a header in the response. By default on requests with response statuses >= 500 will be retried. | ||
@@ -603,3 +603,3 @@ ```javascript | ||
retries: 5, // max retries | ||
validateRetry: (response) => true // a function that returns true if the request should be retried | ||
validateRetry: (response) => response.responseStatus >= 500 // a function that returns true if the request should be retried | ||
}) | ||
@@ -606,0 +606,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98111