retry-request
Advanced tools
Comparing version 4.0.0 to 4.1.0
'use strict'; | ||
var through = require('through2'); | ||
var debug = require('debug')('retry-request'); | ||
@@ -25,2 +26,3 @@ var DEFAULTS = { | ||
var statusCode = response.statusCode; | ||
debug(`Response status: ${statusCode}`); | ||
@@ -121,2 +123,3 @@ var range; | ||
currentRetryAttempt++; | ||
debug(`Current retry attempt: ${currentRetryAttempt}`); | ||
@@ -166,3 +169,6 @@ if (streamMode) { | ||
setTimeout(makeRequest, getNextRetryDelay(currentRetryAttempt)); | ||
var nextRetryDelay = getNextRetryDelay(currentRetryAttempt); | ||
debug(`Next retry delay: ${nextRetryDelay}`); | ||
setTimeout(makeRequest, nextRetryDelay); | ||
} | ||
@@ -169,0 +175,0 @@ |
{ | ||
"name": "retry-request", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Retry a request.", | ||
@@ -24,13 +24,13 @@ "main": "index.js", | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=8.10.0" | ||
}, | ||
"dependencies": { | ||
"through2": "^2.0.0" | ||
"through2": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"async": "^2.5.0", | ||
"async": "^3.0.1", | ||
"lodash.range": "^3.2.0", | ||
"mocha": "^2.2.5", | ||
"mocha": "^6.1.4", | ||
"request": "^2.87.0" | ||
} | ||
} |
@@ -50,2 +50,8 @@ |![retry-request](logo.png) | ||
## Can I monitor what retry-request is doing internally? | ||
Yes! This project uses [debug](https://www.npmjs.com/package/debug) to provide the current retry attempt, each response status, and the delay computed until the next retry attempt is made. To enable the debug mode, set the environment variable `DEBUG` to *retry-request*. | ||
(Thanks for the implementation, @yihaozhadan!) | ||
## request(requestOptions, [opts], [cb]) | ||
@@ -52,0 +58,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
12396
199
176
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthrough2@3.0.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedxtend@4.0.2(transitive)
Updatedthrough2@^3.0.1