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

Timeout not handled in Search.fetch_all_records #115

Open
phlare opened this issue Jul 13, 2021 · 1 comment
Open

Timeout not handled in Search.fetch_all_records #115

phlare opened this issue Jul 13, 2021 · 1 comment

Comments

@phlare
Copy link

phlare commented Jul 13, 2021

I'm intermittently seeing this unhandled error in my integration with this library:

(braintree 0.10.0) lib/search.ex:41: Braintree.Search.fetch_all_records/4

** (Protocol.UndefinedError) protocol Enumerable not implemented for {:error, :timeout} of type Tuple. This protocol is implemented for the following type(s): Ecto.Adapters.SQL.Stream, Postgrex.Stream, DBConnection.Stream, DBConnection.PrepareStream, Timex.Interval, Stream, Function, File.Stream, Date.Range, HashDict, HashSet, GenEvent.Stream, MapSet, IO.Stream, Range, List, Map

I'm calling Customer.search/1 with params data that looks like:

customer_ids = [1,2,3,4,5,6,7]  #Enum of real ids here obviously
search_params = %{ids: customer_ids}
case Customer.search(search_params) do
    #cases to handle return values
end

For the time being, i've reduced the occurrence of this timeout to almost none, by passing smaller batches of customer_ids to this function, but it would be nice for this to be handled properly and for Customer.search/1 to return {:error, :timeout} or something similar.

@phlare
Copy link
Author

phlare commented Jul 13, 2021

note- i've also upgraded to 0.11.0 in case this was a known issue and resolved in that release, but I don't see anything that would have changed there in the commits between 0.10.0 and 0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants