Skip to content

Commit

Permalink
update tesla config back to via config/config.exs
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Oct 26, 2023
1 parent 8c39f74 commit f8b1d91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 4 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions lib/pakman/ex_aws/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions lib/pakman/instellar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8b1d91

Please sign in to comment.