Skip to content

Add --concurrency flag#163

Closed
jpnelson wants to merge 2 commits intolerna:masterfrom
jpnelson:config-concurrency
Closed

Add --concurrency flag#163
jpnelson wants to merge 2 commits intolerna:masterfrom
jpnelson:config-concurrency

Conversation

@jpnelson
Copy link
Copy Markdown
Contributor

Fixes #162

this.repository = new Repository();
this.progressBar = progressBar;
this.logger = logger;
this.concurrency = (!flags || flags.concurrency === undefined) ? 4 : flags.concurrency;
Copy link
Copy Markdown
Contributor

@jamiebuilds jamiebuilds May 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(!flags ||

I'm pretty sure flags is always an object

I think you can just do:

flags.concurrency || 4

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was broken in the tests actually – flags was null. I imagine that'd also be the case if you used commands programatically.

I also check for undefined specifically so that it's not 0 || 4, so that if you specify 0 you get an error, rather than it just using 4.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is good that it would throw, however I think me might need to add a test to make sure it doesn't accidentally get refactored away the next time somebody reads over that code?!

@jamiebuilds
Copy link
Copy Markdown
Contributor

Nice, thanks

@joscha
Copy link
Copy Markdown
Contributor

joscha commented May 29, 2016

I updated the branch in #170 and also added a few tests around the empty/NaN/negative concurrency.

@jamiebuilds
Copy link
Copy Markdown
Contributor

Merged in #170

@lock
Copy link
Copy Markdown

lock bot commented Dec 28, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants