/var/www/myprog.com.ua/server/node/node_modules/async
NameSizeModeActions
dist/-0755rm
internal/-0755rm
all.js35590644editdlrm
allLimit.js17510644editdlrm
allSeries.js16450644editdlrm
any.js38030644editdlrm
anyLimit.js17860644editdlrm
anySeries.js16800644editdlrm
apply.js2170644editdlrm
applyEach.js19880644editdlrm
applyEachSeries.js13020644editdlrm
asyncify.js37620644editdlrm
auto.js118530644editdlrm
autoInject.js70990644editdlrm
bower.json2390644editdlrm
cargo.js27460644editdlrm
cargoQueue.js33520644editdlrm
CHANGELOG.md334810644editdlrm
compose.js15650644editdlrm
concat.js36520644editdlrm
concatLimit.js20930644editdlrm
concatSeries.js14740644editdlrm
constant.js3020644editdlrm
detect.js32490644editdlrm
detectLimit.js18350644editdlrm
detectSeries.js17410644editdlrm
dir.js12960644editdlrm
doDuring.js23000644editdlrm
doUntil.js17030644editdlrm
doWhilst.js23000644editdlrm
during.js23380644editdlrm
each.js40250644editdlrm
eachLimit.js17900644editdlrm
eachOf.js57430644editdlrm
eachOfLimit.js16380644editdlrm
eachOfSeries.js13300644editdlrm
eachSeries.js15760644editdlrm
ensureAsync.js23110644editdlrm
every.js35590644editdlrm
everyLimit.js17510644editdlrm
everySeries.js16450644editdlrm
filter.js28980644editdlrm
filterLimit.js16550644editdlrm
filterSeries.js15470644editdlrm
find.js32490644editdlrm
findLimit.js18350644editdlrm
findSeries.js17410644editdlrm
flatMap.js36520644editdlrm
flatMapLimit.js20930644editdlrm
flatMapSeries.js14740644editdlrm
foldl.js48780644editdlrm
foldr.js15010644editdlrm
forEach.js40250644editdlrm
forEachLimit.js17900644editdlrm
forEachOf.js57430644editdlrm
forEachOfLimit.js16380644editdlrm
forEachOfSeries.js13300644editdlrm
forEachSeries.js15760644editdlrm
forever.js21180644editdlrm
groupBy.js35980644editdlrm
groupByLimit.js24460644editdlrm
groupBySeries.js13310644editdlrm
index.js199400644editdlrm
inject.js48780644editdlrm
LICENSE10630644editdlrm
log.js11960644editdlrm
map.js45960644editdlrm
mapLimit.js16200644editdlrm
mapSeries.js15150644editdlrm
mapValues.js45900644editdlrm
mapValuesLimit.js21170644editdlrm
mapValuesSeries.js13780644editdlrm
memoize.js30700644editdlrm
nextTick.js14750644editdlrm
package.json22030644editdlrm
parallel.js55740644editdlrm
parallelLimit.js15110644editdlrm
priorityQueue.js14420644editdlrm
queue.js6260644editdlrm
race.js21320644editdlrm
README.md32170644editdlrm
reduce.js48780644editdlrm
reduceRight.js15010644editdlrm
reflect.js22660644editdlrm
reflectAll.js24490644editdlrm
reject.js26760644editdlrm
rejectLimit.js15780644editdlrm
rejectSeries.js14700644editdlrm
retry.js55240644editdlrm
retryable.js25350644editdlrm
select.js28980644editdlrm
selectLimit.js16550644editdlrm
selectSeries.js15470644editdlrm
seq.js26530644editdlrm
series.js58230644editdlrm
setImmediate.js13910644editdlrm
some.js38030644editdlrm
someLimit.js17860644editdlrm
someSeries.js16800644editdlrm
sortBy.js62100644editdlrm
timeout.js27550644editdlrm
times.js14870644editdlrm
timesLimit.js14510644editdlrm
timesSeries.js10610644editdlrm
transform.js55630644editdlrm
tryEach.js25400644editdlrm
unmemoize.js6650644editdlrm
until.js20800644editdlrm
waterfall.js32030644editdlrm
whilst.js23380644editdlrm
wrapSync.js37620644editdlrm
Edit: /var/www/myprog.com.ua/server/node/node_modules/async/retry.js (5524B)
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = retry; var _wrapAsync = require('./internal/wrapAsync.js'); var _wrapAsync2 = _interopRequireDefault(_wrapAsync); var _promiseCallback = require('./internal/promiseCallback.js'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function constant(value) { return function () { return value; }; } /** * 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). * @returns {Promise} a promise if no callback provided * * @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 * }); * */ const DEFAULT_TIMES = 5; const DEFAULT_INTERVAL = 0; function retry(opts, task, callback) { var options = { times: DEFAULT_TIMES, intervalFunc: constant(DEFAULT_INTERVAL) }; if (arguments.length < 3 && typeof opts === 'function') { callback = task || (0, _promiseCallback.promiseCallback)(); task = opts; } else { parseTimes(options, opts); callback = callback || (0, _promiseCallback.promiseCallback)(); } if (typeof task !== 'function') { throw new Error("Invalid arguments for async.retry"); } var _task = (0, _wrapAsync2.default)(task); var attempt = 1; function retryAttempt() { _task((err, ...args) => { if (err === false) return; if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); } else { callback(err, ...args); } }); } retryAttempt(); return callback[_promiseCallback.PROMISE_SYMBOL]; } function parseTimes(acc, t) { if (typeof t === 'object') { acc.times = +t.times || DEFAULT_TIMES; acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+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"); } } module.exports = exports.default;