Conversation
src/hb_http.erl
Outdated
| } | ||
| ], | ||
| hb_store:reset(Store), | ||
| Opts = #{store => Store}, |
There was a problem hiding this comment.
Set Routes here, will not have an impact how parallel property if obtained, because if not present in the Store configuration, it will be fetched from hb_opts:default_message.
| parallel_responses(Res, [], Ref, _Awaiting, _StopAfter, _Admissible, _Statuses, _Opts) -> | ||
| empty_inbox(Ref), | ||
| Res; |
There was a problem hiding this comment.
This is part of a new commit that fixes timeout issues. Accessing http://localhost:8734/0-4Bfb-Mjr-JTvHSAiXOGajNzf60x7ZwxB0_95tJ_KI makes every GraphQL API return an empty response.
This makes is_admissible function to return false, and removes that process from the list. Since the condition here is always for Awaiting request to match 0, it will be waiting forever in the receive because there isn't a timeout there as well.
We can add a timeout in the future, mainly because it would be a "catch all" in case something goes wrong. For this case, it should cover all scenarios, and if a request takes too long to reply, the HTTP request has a timeout to return.
da00446 to
814ce18
Compare
Issue
When set
<<"parallel">> => truein a route, the request will return 404 Not Found, because an error occurred in the code.Example:
#{ % Routes for GraphQL requests to use a remote GraphQL API. <<"template">> => <<"/graphql">>, <<"parallel">> => true, <<"nodes">> => [ #{ <<"prefix">> => <<"https://ao-search-gateway.goldsky.com">>, <<"opts">> => #{ http_client => httpc, protocol => http2 } }, #{ <<"prefix">> => <<"https://arweave-search.goldsky.com">>, <<"opts">> => #{ http_client => httpc, protocol => http2 } }, #{ <<"prefix">> => <<"https://arweave.net">>, <<"opts">> => #{ http_client => gun, protocol => http2 } } ] },Related pull requests