Skip to content
Snippets Groups Projects
Commit 62af82fc authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(changelog): reduce concurrency to 10

parent 64d84ff9
No related branches found
No related tags found
No related merge requests found
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 });
}
import fs from 'fs-extra'; import fs from 'fs-extra';
import { RenovateConfig } from '../../config'; import { RenovateConfig } from '../../config';
import { logger, setMeta } from '../../logger'; import { logger, setMeta } from '../../logger';
import { platform } from '../../platform'; import { platform } from '../../platform';
import { addSplit, getSplits, splitInit } from '../../util/split'; import { addSplit, getSplits, splitInit } from '../../util/split';
import { getChangeLogJSON } from '../pr/changelog'; import { embedChangelogs } from './changelog';
import handleError from './error'; import handleError from './error';
import { finaliseRepo } from './finalise'; import { finaliseRepo } from './finalise';
import { initRepo } from './init'; import { initRepo } from './init';
...@@ -39,15 +38,7 @@ export async function renovateRepository( ...@@ -39,15 +38,7 @@ export async function renovateRepository(
config config
); );
await ensureOnboardingPr(config, packageFiles, branches); await ensureOnboardingPr(config, packageFiles, branches);
await Promise.all( await embedChangelogs(branches);
branches.map(async (branch) => {
await Promise.all(
branch.upgrades.map(async (upgrade) => {
upgrade.logJSON = await getChangeLogJSON(upgrade); // eslint-disable-line no-param-reassign
})
);
})
);
addSplit('changelogs'); addSplit('changelogs');
const res = await updateRepo(config, branches, branchList); const res = await updateRepo(config, branches, branchList);
addSplit('update'); addSplit('update');
......
...@@ -151,6 +151,7 @@ ...@@ -151,6 +151,7 @@
"node-html-parser": "1.2.16", "node-html-parser": "1.2.16",
"npm": "6.14.5", "npm": "6.14.5",
"p-all": "2.1.0", "p-all": "2.1.0",
"p-map": "^4.0.0",
"parse-diff": "0.7.0", "parse-diff": "0.7.0",
"parse-link-header": "1.0.1", "parse-link-header": "1.0.1",
"pnpm": "3.8.1", "pnpm": "3.8.1",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment