possibility to set tesla adapter in runtime
This commit is contained in:
parent
33e7657fcc
commit
b0eefe235f
@ -12,7 +12,6 @@ defmodule Pleroma.HTTP.Connection do
|
|||||||
protocols: [:http],
|
protocols: [:http],
|
||||||
timeout: 20_000
|
timeout: 20_000
|
||||||
]
|
]
|
||||||
@adapter Application.get_env(:tesla, :adapter)
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Configure a client connection
|
Configure a client connection
|
||||||
@ -24,7 +23,8 @@ defmodule Pleroma.HTTP.Connection do
|
|||||||
@spec new(Keyword.t()) :: Tesla.Env.client()
|
@spec new(Keyword.t()) :: Tesla.Env.client()
|
||||||
def new(opts \\ []) do
|
def new(opts \\ []) do
|
||||||
middleware = [Tesla.Middleware.FollowRedirects]
|
middleware = [Tesla.Middleware.FollowRedirects]
|
||||||
Tesla.client(middleware, {@adapter, options(opts)})
|
adapter = Application.get_env(:tesla, :adapter)
|
||||||
|
Tesla.client(middleware, {adapter, options(opts)})
|
||||||
end
|
end
|
||||||
|
|
||||||
# fetch http options
|
# fetch http options
|
||||||
|
Loading…
Reference in New Issue
Block a user