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

fix: fetch problematic manager deps in series

parent a6a73617
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,21 @@
exports[`workers/repository/process/fetch fetchUpdates() fetches updates 1`] = `
Object {
"maven": Array [
Object {
"deps": Array [
Object {
"datasource": "maven",
"depName": "bbb",
"updates": Array [
"a",
"b",
],
},
],
"packageFile": "pom.xml",
},
],
"npm": Array [
Object {
"deps": Array [
......
......@@ -4,6 +4,7 @@ import * as lookup from './lookup';
import { getConfig, mocked, RenovateConfig } from '../../../../test/util';
import { ManagerApi } from '../../../manager/common';
import * as datasourceNpm from '../../../datasource/npm';
import * as datasourceMaven from '../../../datasource/maven';
const npm: ManagerApi = _npm;
const lookupUpdates = mocked(lookup).lookupUpdates;
......@@ -60,6 +61,12 @@ describe('workers/repository/process/fetch', () => {
it('fetches updates', async () => {
config.rangeStrategy = 'auto';
const packageFiles: any = {
maven: [
{
packageFile: 'pom.xml',
deps: [{ datasource: datasourceMaven.id, depName: 'bbb' }],
},
],
npm: [
{
packageFile: 'package.json',
......
......@@ -87,14 +87,22 @@ async function fetchManagerPackagerFileUpdates(
): Promise<void> {
const { packageFile } = pFile;
const packageFileConfig = mergeChildConfig(managerConfig, pFile);
const queue = pFile.deps.map(dep => (): Promise<void> =>
fetchDepUpdates(packageFileConfig, dep)
);
const { manager } = packageFileConfig;
logger.debug(
{ packageFile, queueLength: queue.length },
{ manager, packageFile, queueLength: pFile.deps.length },
'fetchManagerPackagerFileUpdates starting'
);
await pAll(queue, { concurrency: 5 });
const problematicManagers = ['pip_requirements', 'maven'];
if (problematicManagers.includes(manager)) {
for (const dep of pFile.deps) {
await fetchDepUpdates(packageFileConfig, dep);
}
} else {
const queue = pFile.deps.map(dep => (): Promise<void> =>
fetchDepUpdates(packageFileConfig, dep)
);
await pAll(queue, { concurrency: 5 });
}
logger.debug({ packageFile }, 'fetchManagerPackagerFileUpdates finished');
}
......
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