diff options
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js')
-rw-r--r-- | deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js index 94685652c4..77428cfd00 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js @@ -1,10 +1,11 @@ var RetryOperation = require('./retry_operation'); exports.operation = function(options) { - var retryForever = false; - if (options && options.forever === true) retryForever = true; var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, retryForever); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); }; exports.timeouts = function(options) { @@ -32,6 +33,10 @@ exports.timeouts = function(options) { timeouts.push(this.createTimeout(i, opts)); } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; |