projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of ssh://git.pleroma.social/pleroma/pleroma into feature/delet...
[akkoma]
/
lib
/
pleroma
/
http
/
connection.ex
diff --git
a/lib/pleroma/http/connection.ex
b/lib/pleroma/http/connection.ex
index 76de3fcfe009e5cb0f7815299503186f6278b522..ebacf7902e2c9b10523c7c25d80b70841ef5b841 100644
(file)
--- a/
lib/pleroma/http/connection.ex
+++ b/
lib/pleroma/http/connection.ex
@@
-30,12
+30,12
@@
defmodule Pleroma.HTTP.Connection do
@defaults
|> pool_timeout()
|> Keyword.merge(opts)
@defaults
|> pool_timeout()
|> Keyword.merge(opts)
- |> adapter().options(uri)
+ |> adapter
_helper
().options(uri)
end
defp pool_timeout(opts) do
{config_key, default} =
end
defp pool_timeout(opts) do
{config_key, default} =
- if
Application.get_env(:tesla, :adapter
) == Tesla.Adapter.Gun do
+ if
adapter(
) == Tesla.Adapter.Gun do
{:pools, Config.get([:pools, :default, :timeout])}
else
{:hackney_pools, 10_000}
{:pools, Config.get([:pools, :default, :timeout])}
else
{:hackney_pools, 10_000}
@@
-47,10
+47,12
@@
defmodule Pleroma.HTTP.Connection do
end
@spec after_request(keyword()) :: :ok
end
@spec after_request(keyword()) :: :ok
- def after_request(opts), do: adapter().after_request(opts)
+ def after_request(opts), do: adapter
_helper
().after_request(opts)
- defp adapter do
- case Application.get_env(:tesla, :adapter) do
+ defp adapter, do: Application.get_env(:tesla, :adapter)
+
+ defp adapter_helper do
+ case adapter() do
Tesla.Adapter.Gun -> AdapterHelper.Gun
Tesla.Adapter.Hackney -> AdapterHelper.Hackney
_ -> AdapterHelper
Tesla.Adapter.Gun -> AdapterHelper.Gun
Tesla.Adapter.Hackney -> AdapterHelper.Hackney
_ -> AdapterHelper