Skip to content
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.

Commit

Permalink
feat: default throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Oct 27, 2019
1 parent 128c020 commit 89b94e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/child-mono-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cli.option('--patterns <patterns>', 'Folder glob patterns (by default will take

cli.option('--concurrency <number|auto>', 'Limit the number of active parallel tasks. `auto` = number of cpu cores. By default there is no limit.')

cli.option('--stream [throttle]', 'Stream output directly instead of waiting for the end. You can also throttle (ms) the output when streaming is enabled.', {
cli.option('--stream [throttle]', 'Stream output directly instead of waiting for the end. You can also throttle (ms) the output when streaming is enabled (default 200ms).', {
default: false,
})

Expand All @@ -29,6 +29,8 @@ cli.command('<script>', 'Run a script in the monorepo packages')
if (options.stream && !isNaN(parseInt(options.stream))) {
throttle = parseInt(options.stream)
options.stream = true
} else if (options.stream === true) {
throttle = 200
}
if (options.patterns) {
if (options.patterns.startsWith('[')) {
Expand All @@ -44,6 +46,7 @@ cli.command('<script>', 'Run a script in the monorepo packages')
const time = Date.now()
const { folders } = await monorepoRun({
...options,
streaming: options.stream,
script,
throttle,
})
Expand Down

0 comments on commit 89b94e9

Please sign in to comment.