Skip to content

Commit b07439e

Browse files
authored
Merge pull request #4 from scripbox/hotfix/http_timeouts
Increase response timeout
2 parents 838dcb5 + fc9c50a commit b07439e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

lib/snowplow_tracker/emitter.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ defmodule SnowplowTracker.Emitter do
4040
emitter.request_type
4141
)
4242

43-
with {:ok, response} <- Request.get(url),
43+
with {:ok, response} <- Request.get(url, [recv_timeout: 50000]),
4444
{:ok, body} <- Response.parse(response) do
4545
{:ok, body}
4646
else

test/snowplow_tracker/emitter_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule SnowplowTracker.EmitterTest do
77

88
defmacro with_request_mock(block) do
99
quote do
10-
with_mock Request, get: fn url -> RequestMock.get(url) end do
10+
with_mock Request, get: fn (url, opts) -> RequestMock.get(url, opts) end do
1111
unquote(block)
1212
end
1313
end

test/snowplow_tracker_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defmodule SnowplowTrackerTest do
1313

1414
defmacro with_request_mock(block) do
1515
quote do
16-
with_mock Request, get: fn url -> RequestMock.get(url) end do
16+
with_mock Request, get: fn (url, opts) -> RequestMock.get(url, opts) end do
1717
unquote(block)
1818
end
1919
end

test/support/request_mock.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule SnowplowTracker.RequestMock do
22
require HTTPoison
33

4-
def get(_) do
4+
def get(_, _) do
55
send(self(), "request sent")
66
{:ok, %HTTPoison.Response{status_code: 200, body: "response"}}
77
end

0 commit comments

Comments
 (0)