Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor $WEB_CONCURRENCY handling #931

Merged
merged 3 commits into from
Jul 1, 2021
Merged

Conversation

dzuelke
Copy link
Contributor

@dzuelke dzuelke commented Jun 30, 2021

Changes the various functions around so they no longer have side effects.

@dzuelke dzuelke requested a review from a team as a code owner June 30, 2021 15:59

validate_concurrency() {
local concurrency=$1
local oob=0
Copy link
Member

Choose a reason for hiding this comment

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

What does oob mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"out of bounds"; it's the return value (as opposed to function result, which is what gets echo'd so you can capture it with $()) that lets calling code determine whether the calculated (or given) was too high or too low

Copy link
Contributor Author

@dzuelke dzuelke Jul 1, 2021

Choose a reason for hiding this comment

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

That's why the "#FIXME" comment is there - we could also change the warning function to warn_high_concurrency, removing the logic that checks for > 200 (which right now is still duplicated), and only call it if oob == 2

Copy link
Member

Choose a reason for hiding this comment

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

Got it now, thanks. Maybe worth adding a code comment about it? We could also eliminate the name oob completely as it's really just the return value. local return_value maybe? I was looking for a deeper meaning beyond "1 is lower bound exceeded and 2 is upper bound exceeded".


validate_concurrency() {
local concurrency=$1
local oob=0
Copy link
Member

Choose a reason for hiding this comment

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

Got it now, thanks. Maybe worth adding a code comment about it? We could also eliminate the name oob completely as it's really just the return value. local return_value maybe? I was looking for a deeper meaning beyond "1 is lower bound exceeded and 2 is upper bound exceeded".

@dzuelke dzuelke merged commit d3b484a into main Jul 1, 2021
@dzuelke dzuelke deleted the refactor-web-concurrency branch July 1, 2021 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants