Skip to content

Commit

Permalink
pass recv_timeout option to httpoison.post! call
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo committed Mar 30, 2021
1 parent 3189dec commit 2e9b891
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/humiex/client/http_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ defmodule Humiex.Client.HTTPClient do
end

@impl true
def start(%State{client: %Client{url: url, headers: headers}} = state) do
def start(%State{client: %Client{url: url, headers: headers}, opts: opts} = state) do
fn ->
body = to_body(state)
resp = HTTPoison.post!(url, body, headers, stream_to: self(), async: :once)
recv_timeout = Keyword.get(opts, :recv_timeout, @default_recv_timeout)

resp =
HTTPoison.post!(url, body, headers,
stream_to: self(),
async: :once,
recv_timeout: recv_timeout
)

%State{
state
Expand Down

0 comments on commit 2e9b891

Please sign in to comment.