projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support blocking via query parameters as well and document the change.
[akkoma]
/
lib
/
pleroma
/
http
/
adapter_helper.ex
diff --git
a/lib/pleroma/http/adapter_helper.ex
b/lib/pleroma/http/adapter_helper.ex
index 8ca433732a01068e6b3617fa81f82f832b26c95d..9ec3836b057122243b174201eecc08d9db92afb8 100644
(file)
--- a/
lib/pleroma/http/adapter_helper.ex
+++ b/
lib/pleroma/http/adapter_helper.ex
@@
-44,15
+44,17
@@
defmodule Pleroma.HTTP.AdapterHelper do
@spec options(URI.t(), keyword()) :: keyword()
def options(%URI{} = uri, opts \\ []) do
@defaults
@spec options(URI.t(), keyword()) :: keyword()
def options(%URI{} = uri, opts \\ []) do
@defaults
- |> p
ool
_timeout()
+ |> p
ut
_timeout()
|> Keyword.merge(opts)
|> adapter_helper().options(uri)
end
|> Keyword.merge(opts)
|> adapter_helper().options(uri)
end
- defp pool_timeout(opts) do
+ # For Hackney, this is the time a connection can stay idle in the pool.
+ # For Gun, this is the timeout to receive a message from Gun.
+ defp put_timeout(opts) do
{config_key, default} =
if adapter() == Tesla.Adapter.Gun do
{config_key, default} =
if adapter() == Tesla.Adapter.Gun do
- {:pools, Config.get([:pools, :default, :timeout])}
+ {:pools, Config.get([:pools, :default, :timeout]
, 5_000
)}
else
{:hackney_pools, 10_000}
end
else
{:hackney_pools, 10_000}
end