File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ program
3737 '--max <number>' ,
3838 'Maximum number of files to process in one batch (per language) (default: unlimited)' ,
3939 )
40+ . option (
41+ '--concurrency <number>' ,
42+ 'Number of concurrent translation tasks (default: 10)' ,
43+ )
4044 . action (
4145 async ( options : {
4246 config ?: string ;
@@ -46,6 +50,7 @@ program
4650 listOnly ?: boolean ;
4751 targetLanguage ?: string ;
4852 max ?: number ;
53+ concurrency ?: number ;
4954 } ) => {
5055 if ( options . verbose ) {
5156 logger . setVerbose ( true ) ;
@@ -60,6 +65,7 @@ program
6065 ...( options . pattern ? { pattern : options . pattern } : { } ) ,
6166 ...( options . docsPath ? { docsPath : options . docsPath } : { } ) ,
6267 ...( options . max ? { max : options . max } : { } ) ,
68+ ...( options . concurrency ? { concurrency : options . concurrency } : { } ) ,
6369 listOnly : options . listOnly ,
6470 targetLanguage : options . targetLanguage ,
6571 } ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export async function main({
2222 listOnly,
2323 max = Number . POSITIVE_INFINITY ,
2424 targetLanguage,
25+ concurrency = 10 ,
2526} : MainConfig ) : Promise < void > {
2627 // Filter languages based on targetLanguage if specified
2728 const filteredLangs = targetLanguage
@@ -190,7 +191,6 @@ export async function main({
190191 // Process tasks if not in list-only mode
191192 if ( ! listOnly ) {
192193 let completedRefDocs = 0 ;
193- const concurrency = 10 ;
194194
195195 await executeInBatches (
196196 tasks ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export interface MainConfig {
2727 max ?: number ;
2828 listOnly ?: boolean ;
2929 targetLanguage ?: string ;
30+ concurrency ?: number ;
3031}
3132
3233export interface TranslationResult {
You can’t perform that action at this time.
0 commit comments