diff --git a/config/config.exs b/config/config.exs index 29b8742..bf4ff9f 100644 --- a/config/config.exs +++ b/config/config.exs @@ -2,6 +2,10 @@ # and its dependencies with the aid of the Mix.Config module. import Config +config :tesla, + :adapter, + {Tesla.Adapter.Finch, name: Pakman.Finch, receive_timeout: 30_000} + config :ex_aws, http_client: Pakman.ExAws.Client diff --git a/lib/pakman/ex_aws/client.ex b/lib/pakman/ex_aws/client.ex index a79d38b..80ced83 100644 --- a/lib/pakman/ex_aws/client.ex +++ b/lib/pakman/ex_aws/client.ex @@ -2,9 +2,7 @@ defmodule Pakman.ExAws.Client do @behaviour ExAws.Request.HttpClient def request(method, url, body, headers, _http_opts) do [{Tesla.Middleware.Logger, debug: false}] - |> Tesla.client( - {Tesla.Adapter.Finch, name: Pakman.Finch, receive_timeout: 30_000} - ) + |> Tesla.client() |> Tesla.request(method: method, url: url, body: body, headers: headers) end end diff --git a/lib/pakman/instellar.ex b/lib/pakman/instellar.ex index 72761de..94b0500 100644 --- a/lib/pakman/instellar.ex +++ b/lib/pakman/instellar.ex @@ -157,10 +157,7 @@ defmodule Pakman.Instellar do ] end - Tesla.client( - middleware, - {Tesla.Adapter.Finch, name: Pakman.Finch, receive_timeout: 30_000} - ) + Tesla.client(middleware) end defp custom_log_level(env) do