Skip to content

Commit

Permalink
Merge pull request #405 from snyk-tech-services/fix/remove-concurrenc…
Browse files Browse the repository at this point in the history
…y-error

Fix/remove concurrency error
  • Loading branch information
lili2311 authored Dec 16, 2022
2 parents 6a5055d + 5d2b2fc commit a5c165c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
12 changes: 12 additions & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ export const targetProps = [
'branch',
];
export const targetPropsWithId = [...targetProps, 'id'];

export const defaultExclusionGlobs = [
'fixtures',
'tests',
'__tests__',
'test',
'__test__',
'ci',
'node_modules',
'bower_components',
'.git',
];
12 changes: 1 addition & 11 deletions src/scripts/sync/clone-and-analyze.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as debugLib from 'debug';
import * as fs from 'fs';
import * as path from 'path';
import { defaultExclusionGlobs } from '../../common';

import { find, getSCMSupportedManifests, gitClone } from '../../lib';
import type { SnykProductEntitlement } from '../../lib/supported-project-types/supported-manifests';
Expand All @@ -14,17 +15,6 @@ import { generateProjectDiffActions } from './generate-projects-diff-actions';

const debug = debugLib('snyk:clone-and-analyze');

const defaultExclusionGlobs = [
'fixtures',
'tests',
'__tests__',
'test',
'__test__',
'ci',
'node_modules',
'bower_components',
'.git',
];
export async function cloneAndAnalyze(
integrationType: SupportedIntegrationTypesUpdateProject,
repoMetadata: RepoMetaData,
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/sync/sync-org-projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export async function updateTargets(
const failedProjects: ProjectUpdateFailure[] = [];

const loggingPath = getLoggingPath();
const concurrentTargets = 100;
const concurrentTargets = 30;

await pMap(
targets,
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/sync/sync-projects-per-target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export async function bulkDeactivateProjects(
);
}
},
{ concurrency: 100 },
{ concurrency: 50 },
);

return { updated, failed };
Expand Down

0 comments on commit a5c165c

Please sign in to comment.