Skip to content

Commit

Permalink
fix(changelog): reduce concurrency to 10
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 8, 2020
1 parent 64d84ff commit 62af82f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
18 changes: 18 additions & 0 deletions lib/workers/repository/changelog/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pMap from 'p-map';
import { getChangeLogJSON } from '../../pr/changelog';

// istanbul ignore next
async function embedChangelog(upgrade): Promise<void> {
upgrade.logJSON = await getChangeLogJSON(upgrade); // eslint-disable-line
}

// istanbul ignore next
export async function embedChangelogs(branches): Promise<void> {
const upgrades = [];
for (const branch of branches) {
for (const upgrade of branch.upgrades) {
upgrades.push(upgrade);
}
}
await pMap(upgrades, embedChangelog, { concurrency: 10 });
}
13 changes: 2 additions & 11 deletions lib/workers/repository/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import fs from 'fs-extra';

import { RenovateConfig } from '../../config';
import { logger, setMeta } from '../../logger';
import { platform } from '../../platform';
import { addSplit, getSplits, splitInit } from '../../util/split';
import { getChangeLogJSON } from '../pr/changelog';
import { embedChangelogs } from './changelog';
import handleError from './error';
import { finaliseRepo } from './finalise';
import { initRepo } from './init';
Expand Down Expand Up @@ -39,15 +38,7 @@ export async function renovateRepository(
config
);
await ensureOnboardingPr(config, packageFiles, branches);
await Promise.all(
branches.map(async (branch) => {
await Promise.all(
branch.upgrades.map(async (upgrade) => {
upgrade.logJSON = await getChangeLogJSON(upgrade); // eslint-disable-line no-param-reassign
})
);
})
);
await embedChangelogs(branches);
addSplit('changelogs');
const res = await updateRepo(config, branches, branchList);
addSplit('update');
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"node-html-parser": "1.2.16",
"npm": "6.14.5",
"p-all": "2.1.0",
"p-map": "^4.0.0",
"parse-diff": "0.7.0",
"parse-link-header": "1.0.1",
"pnpm": "3.8.1",
Expand Down

0 comments on commit 62af82f

Please sign in to comment.