-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from CargoSense/timeout-fix
Fix HTTP request issues
- Loading branch information
Showing
8 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
defmodule ExAws.Request.HTTPoison do | ||
@behaviour ExAws.Request.HttpClient | ||
|
||
@moduledoc """ | ||
Configuration for HTTPoison | ||
Options can set for HTTPoison with the following config | ||
HTTPoison 0.7.X | ||
``` | ||
config :ex_aws, :httpoison_opts, | ||
recv_timeout: 30_000 | ||
``` | ||
HTTPoison 0.6.X | ||
``` | ||
config :ex_aws, :httpoison_opts, | ||
hackney: [recv_timeout: 30_000] | ||
``` | ||
The default config handles setting both of the above | ||
""" | ||
|
||
@default_timeout 30_000 | ||
|
||
# The recv_timeout is repeated inside :hackney because in 0.6.X of | ||
# HTTPoison it couldn't be set as an option to httpoison directly. | ||
@default_opts [ | ||
recv_timeout: @default_timeout, | ||
hackney: [recv_timeout: @default_timeout] | ||
] | ||
|
||
def request(method, url, body, headers) do | ||
opts = Application.get_env(:ex_aws, :httpoison_opts, @default_opts) | ||
HTTPoison.request(method, url, body, headers, opts) | ||
end | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters