mirror of
https://github.com/azure/login.git
synced 2026-06-06 13:47:07 +00:00
* Bump lodash from 4.17.15 to 4.17.19 (#52) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * Bump @actions/core from 1.1.3 to 1.2.6 (#60) Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.1.3 to 1.2.6. - [Release notes](https://github.com/actions/toolkit/releases) - [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Amruta Kawade <65217380+AmrutaKawade@users.noreply.github.com> * updating node_nodules * updated package-lock Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
55 lines
No EOL
1.8 KiB
JavaScript
55 lines
No EOL
1.8 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports["default"] = parallelLimit;
|
|
|
|
var _parallel = _interopRequireDefault(require("./_parallel"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
|
|
/**
|
|
* Run `tasks` callback functions in parallel limited to `limit` parallel
|
|
* running tasks.
|
|
*
|
|
* Does not stop parallel execution on errors. *All tasks get executed.*
|
|
* The optional `callback` gets called after the longest running task finishes.
|
|
*
|
|
* @name parallelLimit
|
|
* @memberOf module:parallel
|
|
* @static
|
|
* @method
|
|
* @param {Number} limit - number of tasks running in parallel
|
|
* @param {Array} tasks - Array of callback functions of type `function (cb: Function)`
|
|
* @param {Object} [options]
|
|
* @param {Number} [options.timeout] - timeout in ms which throwing `AsynccError` in case that `tasks` are still running
|
|
* @param {Boolean} [options.bail] - bail-out on first error
|
|
* @param {Function} [callback] - optional callback function called by last
|
|
* terminating function from `tasks`, needs to be of type
|
|
* `function (err: AsynccError, result: Array<any>)`
|
|
* where `err.errors` is an Array containing the errors in the same
|
|
* order as the `res` results array. `err.errpos` gives the positions of errors in
|
|
* order as they occur.
|
|
*
|
|
* @example
|
|
* // runs 2 tasks in parallel
|
|
* parallelLimit(2, [
|
|
* (cb) => { cb(null, 1) },
|
|
* (cb) => { cb('error', 2) },
|
|
* (cb) => { cb(null, 3) }
|
|
* ], (err, res) => {
|
|
* //> err.errors = [null, 'error', null]
|
|
* //> err.errorpos = [1]
|
|
* //> res = [1, 2, 3]
|
|
* })
|
|
*/
|
|
function parallelLimit(limit, tasks, opts, callback) {
|
|
function run(j, cb) {
|
|
tasks[j](function (err, res) {
|
|
cb(j, err, res);
|
|
});
|
|
}
|
|
|
|
(0, _parallel["default"])(limit, tasks.length, run, opts, callback);
|
|
} |