-
Notifications
You must be signed in to change notification settings - Fork 3
Improve bulk handling of empty values #44
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
Changes from all commits
746f771
64fe056
9e4619e
2ff0b31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ def verify_each_address_concurrently | |
| addresses.each_with_index do |address, index_of_address| | ||
| # Start a new thread for each task | ||
| pool.post do | ||
| verify_address(address, index_of_address) | ||
| @results[index_of_address] = verify_address(address) | ||
| end | ||
| end | ||
|
|
||
|
|
@@ -58,11 +58,12 @@ def verify_each_address_concurrently | |
| end | ||
|
|
||
| # Verifies a single address, and writes the result into @results | ||
| def verify_address(address, index_of_address) | ||
| @results[index_of_address] = | ||
| AddressFinder::V2::Au::Verification.new(q: address, http: http.clone, **args).perform.result | ||
| def verify_address(address) | ||
| return if address.empty? | ||
|
|
||
| AddressFinder::V2::Au::Verification.new(q: address, http: http.clone, **args).perform.result || false | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. both AU and NZ verification classes here will assign |
||
| rescue AddressFinder::RequestRejectedError => e | ||
| @results[index_of_address] = OpenStruct.new(success: false, body: e.body, status: e.status) | ||
| OpenStruct.new(success: false, body: e.body, status: e.status) | ||
| end | ||
| end | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️