/
usr
/
lib
/
node_modules
/
pm2
/
node_modules
/
async
/
/usr/lib/node_modules/pm2/node_modules/async
mkdir
upload
Name
Size
Mode
Actions
dist/
-
0755
rm
internal/
-
0755
rm
all.js
1838
0644
edit
dl
rm
allLimit.js
1741
0644
edit
dl
rm
allSeries.js
1635
0644
edit
dl
rm
any.js
1904
0644
edit
dl
rm
anyLimit.js
1776
0644
edit
dl
rm
anySeries.js
1670
0644
edit
dl
rm
apply.js
3121
0644
edit
dl
rm
applyEach.js
1983
0644
edit
dl
rm
applyEachSeries.js
1297
0644
edit
dl
rm
asyncify.js
3730
0644
edit
dl
rm
auto.js
9336
0644
edit
dl
rm
autoInject.js
6241
0644
edit
dl
rm
bower.json
239
0644
edit
dl
rm
cargo.js
2742
0644
edit
dl
rm
cargoQueue.js
3348
0644
edit
dl
rm
CHANGELOG.md
32822
0644
edit
dl
rm
compose.js
1561
0644
edit
dl
rm
concat.js
1735
0644
edit
dl
rm
concatLimit.js
2087
0644
edit
dl
rm
concatSeries.js
1467
0644
edit
dl
rm
constant.js
2977
0644
edit
dl
rm
detect.js
2225
0644
edit
dl
rm
detectLimit.js
1814
0644
edit
dl
rm
detectSeries.js
1720
0644
edit
dl
rm
dir.js
1294
0644
edit
dl
rm
doDuring.js
2294
0644
edit
dl
rm
doUntil.js
1700
0644
edit
dl
rm
doWhilst.js
2294
0644
edit
dl
rm
during.js
2324
0644
edit
dl
rm
each.js
3046
0644
edit
dl
rm
eachLimit.js
1777
0644
edit
dl
rm
eachOf.js
3577
0644
edit
dl
rm
eachOfLimit.js
1628
0644
edit
dl
rm
eachOfSeries.js
1323
0644
edit
dl
rm
eachSeries.js
1569
0644
edit
dl
rm
ensureAsync.js
2308
0644
edit
dl
rm
every.js
1838
0644
edit
dl
rm
everyLimit.js
1741
0644
edit
dl
rm
everySeries.js
1635
0644
edit
dl
rm
filter.js
1787
0644
edit
dl
rm
filterLimit.js
1645
0644
edit
dl
rm
filterSeries.js
1537
0644
edit
dl
rm
find.js
2225
0644
edit
dl
rm
findLimit.js
1814
0644
edit
dl
rm
findSeries.js
1720
0644
edit
dl
rm
flatMap.js
1735
0644
edit
dl
rm
flatMapLimit.js
2087
0644
edit
dl
rm
flatMapSeries.js
1467
0644
edit
dl
rm
foldl.js
2744
0644
edit
dl
rm
foldr.js
1494
0644
edit
dl
rm
forEach.js
3046
0644
edit
dl
rm
forEachLimit.js
1777
0644
edit
dl
rm
forEachOf.js
3577
0644
edit
dl
rm
forEachOfLimit.js
1628
0644
edit
dl
rm
forEachOfSeries.js
1323
0644
edit
dl
rm
forEachSeries.js
1569
0644
edit
dl
rm
forever.js
2109
0644
edit
dl
rm
groupBy.js
2177
0644
edit
dl
rm
groupByLimit.js
2440
0644
edit
dl
rm
groupBySeries.js
1328
0644
edit
dl
rm
index.js
19730
0644
edit
dl
rm
inject.js
2744
0644
edit
dl
rm
LICENSE
1063
0644
edit
dl
rm
log.js
1194
0644
edit
dl
rm
map.js
2339
0644
edit
dl
rm
mapLimit.js
1610
0644
edit
dl
rm
mapSeries.js
1505
0644
edit
dl
rm
mapValues.js
2274
0644
edit
dl
rm
mapValuesLimit.js
2108
0644
edit
dl
rm
mapValuesSeries.js
1374
0644
edit
dl
rm
memoize.js
3064
0644
edit
dl
rm
nextTick.js
1474
0644
edit
dl
rm
package.json
3351
0644
edit
dl
rm
parallel.js
3174
0644
edit
dl
rm
parallelLimit.js
1504
0644
edit
dl
rm
priorityQueue.js
2652
0644
edit
dl
rm
queue.js
7373
0644
edit
dl
rm
race.js
2090
0644
edit
dl
rm
README.md
3463
0644
edit
dl
rm
reduce.js
2744
0644
edit
dl
rm
reduceRight.js
1494
0644
edit
dl
rm
reflect.js
2263
0644
edit
dl
rm
reflectAll.js
2449
0644
edit
dl
rm
reject.js
1712
0644
edit
dl
rm
rejectLimit.js
1568
0644
edit
dl
rm
rejectSeries.js
1460
0644
edit
dl
rm
retry.js
5521
0644
edit
dl
rm
retryable.js
2526
0644
edit
dl
rm
select.js
1787
0644
edit
dl
rm
selectLimit.js
1645
0644
edit
dl
rm
selectSeries.js
1537
0644
edit
dl
rm
seq.js
2650
0644
edit
dl
rm
series.js
3017
0644
edit
dl
rm
setImmediate.js
1389
0644
edit
dl
rm
some.js
1904
0644
edit
dl
rm
someLimit.js
1776
0644
edit
dl
rm
someSeries.js
1670
0644
edit
dl
rm
sortBy.js
2741
0644
edit
dl
rm
timeout.js
2752
0644
edit
dl
rm
times.js
1483
0644
edit
dl
rm
timesLimit.js
1439
0644
edit
dl
rm
timesSeries.js
1057
0644
edit
dl
rm
transform.js
2754
0644
edit
dl
rm
tryEach.js
2534
0644
edit
dl
rm
unmemoize.js
668
0644
edit
dl
rm
until.js
2077
0644
edit
dl
rm
waterfall.js
3158
0644
edit
dl
rm
whilst.js
2324
0644
edit
dl
rm
wrapSync.js
3730
0644
edit
dl
rm
Edit:
/usr/lib/node_modules/pm2/node_modules/async/retry.js
(5521B)
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = retry; var _wrapAsync = require('./internal/wrapAsync'); var _wrapAsync2 = _interopRequireDefault(_wrapAsync); var _promiseCallback = require('./internal/promiseCallback'); 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'];
Save
cmd:
run