Skip to content

Commit

Permalink
refactor(run-topologically): Do not pass figgy config down to constru…
Browse files Browse the repository at this point in the history
…ctors directly
  • Loading branch information
evocateur committed May 14, 2019
1 parent af870bb commit ccaf987
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions utils/run-topologically/run-topologically.js
Expand Up @@ -9,7 +9,11 @@ module.exports = runTopologically;
const TopologicalConfig = figgyPudding({
// p-queue options
concurrency: {},
// query-graph options handled elsewhere
// query-graph options
"graph-type": {},
graphType: "graph-type",
"reject-cycles": {},
rejectCycles: "reject-cycles",
});

/**
Expand All @@ -23,10 +27,10 @@ const TopologicalConfig = figgyPudding({
* @returns {Promise<Array<*>>} when all executions complete
*/
function runTopologically(packages, runner, opts) {
const options = TopologicalConfig(opts);
const { concurrency, graphType, rejectCycles } = TopologicalConfig(opts);

const queue = new PQueue(options);
const graph = new QueryGraph(packages, options);
const queue = new PQueue({ concurrency });
const graph = new QueryGraph(packages, { graphType, rejectCycles });

return new Promise((resolve, reject) => {
const returnValues = [];
Expand Down

0 comments on commit ccaf987

Please sign in to comment.