Skip to content

Commit 348b2de

Browse files
cherkanovartvrcprl
andauthored
fix(cli): remove hardcoded concurrency limit and add warning for high concurrency (#1738)
Co-authored-by: Veronica Prilutskaya <veronica@lingo.dev>
1 parent 61b9006 commit 348b2de

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.changeset/ninety-mirrors-smash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": minor
3+
---
4+
5+
Remove hardcoded concurrency limit

packages/cli/src/cli/cmd/run/execute.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,22 @@ import { commonTaskRendererOptions } from "./_const";
1010
import createBucketLoader from "../../loaders";
1111
import { createDeltaProcessor, Delta } from "../../utils/delta";
1212

13-
const MAX_WORKER_COUNT = 10;
13+
const WARN_CONCURRENCY_COUNT = 30;
1414

1515
export default async function execute(input: CmdRunContext) {
1616
const effectiveConcurrency = Math.min(
1717
input.flags.concurrency,
1818
input.tasks.length,
19-
MAX_WORKER_COUNT,
2019
);
20+
21+
if (effectiveConcurrency >= WARN_CONCURRENCY_COUNT) {
22+
console.warn(
23+
chalk.yellow(
24+
`⚠️ High concurrency (${effectiveConcurrency}) may cause failures in some environments.`,
25+
),
26+
);
27+
}
28+
2129
console.log(chalk.hex(colors.orange)(`[Localization]`));
2230

2331
return new Listr<CmdRunContext>(

0 commit comments

Comments
 (0)