/usr/local/lib/node_modules/pm2/node_modules/vizion/node_modules/async
NameSizeModeActions
dist/-0755rm
internal/-0755rm
all.js16800644editdlrm
allLimit.js15450644editdlrm
allSeries.js12750644editdlrm
any.js17580644editdlrm
anyLimit.js15920644editdlrm
anySeries.js13140644editdlrm
apply.js18430644editdlrm
applyEach.js17790644editdlrm
applyEachSeries.js12850644editdlrm
asyncify.js35000644editdlrm
auto.js98440644editdlrm
autoInject.js64810644editdlrm
bower.json2450644editdlrm
cargo.js46510644editdlrm
CHANGELOG.md293400644editdlrm
compose.js15610644editdlrm
concat.js15880644editdlrm
concatLimit.js21620644editdlrm
concatSeries.js12720644editdlrm
constant.js17600644editdlrm
detect.js22080644editdlrm
detectLimit.js17600644editdlrm
detectSeries.js13530644editdlrm
dir.js12940644editdlrm
doDuring.js21830644editdlrm
doUntil.js13740644editdlrm
doWhilst.js20640644editdlrm
during.js22010644editdlrm
each.js28360644editdlrm
eachLimit.js15680644editdlrm
eachOf.js33680644editdlrm
eachOfLimit.js14180644editdlrm
eachOfSeries.js11370644editdlrm
eachSeries.js12060644editdlrm
ensureAsync.js25150644editdlrm
every.js16800644editdlrm
everyLimit.js15450644editdlrm
everySeries.js12750644editdlrm
filter.js15240644editdlrm
filterLimit.js13440644editdlrm
filterSeries.js12360644editdlrm
find.js22080644editdlrm
findLimit.js17600644editdlrm
findSeries.js13530644editdlrm
foldl.js26760644editdlrm
foldr.js15360644editdlrm
forEach.js28360644editdlrm
forEachLimit.js15680644editdlrm
forEachOf.js33680644editdlrm
forEachOfLimit.js14180644editdlrm
forEachOfSeries.js11370644editdlrm
forEachSeries.js12060644editdlrm
forever.js19410644editdlrm
groupBy.js21310644editdlrm
groupByLimit.js23790644editdlrm
groupBySeries.js13470644editdlrm
index.js195030644editdlrm
inject.js26760644editdlrm
LICENSE10630644editdlrm
log.js11940644editdlrm
map.js20810644editdlrm
mapLimit.js13140644editdlrm
mapSeries.js12090644editdlrm
mapValues.js22410644editdlrm
mapValuesLimit.js20370644editdlrm
mapValuesSeries.js13280644editdlrm
memoize.js32320644editdlrm
nextTick.js14470644editdlrm
package.json24120644editdlrm
parallel.js31000644editdlrm
parallelLimit.js14220644editdlrm
priorityQueue.js31040644editdlrm
queue.js58550644editdlrm
race.js21620644editdlrm
README.md25360644editdlrm
reduce.js26760644editdlrm
reduceRight.js15360644editdlrm
reflect.js23790644editdlrm
reflectAll.js27950644editdlrm
reject.js14480644editdlrm
rejectLimit.js12660644editdlrm
rejectSeries.js11580644editdlrm
retry.js54350644editdlrm
retryable.js20250644editdlrm
select.js15240644editdlrm
selectLimit.js13440644editdlrm
selectSeries.js12360644editdlrm
seq.js29860644editdlrm
series.js29370644editdlrm
setImmediate.js13890644editdlrm
some.js17580644editdlrm
someLimit.js15920644editdlrm
someSeries.js13140644editdlrm
sortBy.js28290644editdlrm
timeout.js27760644editdlrm
times.js14590644editdlrm
timesLimit.js13930644editdlrm
timesSeries.js10210644editdlrm
transform.js27150644editdlrm
tryEach.js25600644editdlrm
unmemoize.js6810644editdlrm
until.js14460644editdlrm
waterfall.js33430644editdlrm
whilst.js21910644editdlrm
wrapSync.js35000644editdlrm
Edit: /usr/local/lib/node_modules/pm2/node_modules/vizion/node_modules/async/retry.js (5435B)
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = retry; var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); var _constant = require('lodash/constant'); var _constant2 = _interopRequireDefault(_constant); var _wrapAsync = require('./internal/wrapAsync'); var _wrapAsync2 = _interopRequireDefault(_wrapAsync); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Attempts to get a successful response from `task` no more than `times` times * before returning an error. If the task is successful, the `callback` will be * passed the result of the successful task. If all attempts fail, the callback * will be passed the error and result (if any) of the final attempt. * * @name retry * @static * @memberOf module:ControlFlow * @method * @category Control Flow * @see [async.retryable]{@link module:ControlFlow.retryable} * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an * object with `times` and `interval` or a number. * * `times` - The number of attempts to make before giving up. The default * is `5`. * * `interval` - The time to wait between retries, in milliseconds. The * default is `0`. The interval may also be specified as a function of the * retry count (see example). * * `errorFilter` - An optional synchronous function that is invoked on * erroneous result. If it returns `true` the retry attempts will continue; * if the function returns `false` the retry flow is aborted with the current * attempt's error and result being returned to the final callback. * Invoked with (err). * * If `opts` is a number, the number specifies the number of times to retry, * with the default interval of `0`. * @param {AsyncFunction} task - An async function to retry. * Invoked with (callback). * @param {Function} [callback] - An optional callback which is called when the * task has succeeded, or after the final failed attempt. It receives the `err` * and `result` arguments of the last attempt at completing the `task`. Invoked * with (err, results). * * @example * * // The `retry` function can be used as a stand-alone control flow by passing * // a callback, as shown below: * * // try calling apiMethod 3 times * async.retry(3, apiMethod, function(err, result) { * // do something with the result * }); * * // try calling apiMethod 3 times, waiting 200 ms between each retry * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { * // do something with the result * }); * * // try calling apiMethod 10 times with exponential backoff * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) * async.retry({ * times: 10, * interval: function(retryCount) { * return 50 * Math.pow(2, retryCount); * } * }, apiMethod, function(err, result) { * // do something with the result * }); * * // try calling apiMethod the default 5 times no delay between each retry * async.retry(apiMethod, function(err, result) { * // do something with the result * }); * * // try calling apiMethod only when error condition satisfies, all other * // errors will abort the retry control flow and return to final callback * async.retry({ * errorFilter: function(err) { * return err.message === 'Temporary error'; // only retry on a specific error * } * }, apiMethod, function(err, result) { * // do something with the result * }); * * // to retry individual methods that are not as reliable within other * // control flow functions, use the `retryable` wrapper: * async.auto({ * users: api.getUsers.bind(api), * payments: async.retryable(3, api.getPayments.bind(api)) * }, function(err, results) { * // do something with the results * }); * */ function retry(opts, task, callback) { var DEFAULT_TIMES = 5; var DEFAULT_INTERVAL = 0; var options = { times: DEFAULT_TIMES, intervalFunc: (0, _constant2.default)(DEFAULT_INTERVAL) }; function parseTimes(acc, t) { if (typeof t === 'object') { acc.times = +t.times || DEFAULT_TIMES; acc.intervalFunc = typeof t.interval === 'function' ? t.interval : (0, _constant2.default)(+t.interval || DEFAULT_INTERVAL); acc.errorFilter = t.errorFilter; } else if (typeof t === 'number' || typeof t === 'string') { acc.times = +t || DEFAULT_TIMES; } else { throw new Error("Invalid arguments for async.retry"); } } if (arguments.length < 3 && typeof opts === 'function') { callback = task || _noop2.default; task = opts; } else { parseTimes(options, opts); callback = callback || _noop2.default; } if (typeof task !== 'function') { throw new Error("Invalid arguments for async.retry"); } var _task = (0, _wrapAsync2.default)(task); var attempt = 1; function retryAttempt() { _task(function (err) { if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt)); } else { callback.apply(null, arguments); } }); } retryAttempt(); } module.exports = exports['default'];