Use the number of CPU cores as the default for --parallel

This commit is contained in:
freearhey
2025-09-03 06:16:56 +03:00
parent d42536e68d
commit 1b44e9c6dd

View File

@@ -5,6 +5,7 @@ import { Stream } from '../../models'
import { program } from 'commander' import { program } from 'commander'
import { eachLimit } from 'async-es' import { eachLimit } from 'async-es'
import chalk from 'chalk' import chalk from 'chalk'
import os from 'node:os'
import type { DataLoaderData } from '../../types/dataLoader' import type { DataLoaderData } from '../../types/dataLoader'
import type { DataProcessorData } from '../../types/dataProcessor' import type { DataProcessorData } from '../../types/dataProcessor'
@@ -24,7 +25,7 @@ program
'-p, --parallel <number>', '-p, --parallel <number>',
'Batch size of streams to test concurrently', 'Batch size of streams to test concurrently',
(value: string) => parseInt(value), (value: string) => parseInt(value),
10 os.cpus().length
) )
.option('-x, --proxy <url>', 'Use the specified proxy') .option('-x, --proxy <url>', 'Use the specified proxy')
.parse(process.argv) .parse(process.argv)