remove try block from pool request
This commit is contained in:
parent
aaa879ce75
commit
24bf5c4e89
|
@ -99,23 +99,11 @@ def request(%Client{} = client, request, %{pool_alive?: false}) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def request(%Client{} = client, request, %{pool: pool, timeout: timeout}) do
|
def request(%Client{} = client, request, %{pool: pool, timeout: timeout}) do
|
||||||
try do
|
|
||||||
:poolboy.transaction(
|
:poolboy.transaction(
|
||||||
pool,
|
pool,
|
||||||
&Pleroma.Pool.Request.execute(&1, client, request, timeout),
|
&Pleroma.Pool.Request.execute(&1, client, request, timeout),
|
||||||
timeout
|
timeout
|
||||||
)
|
)
|
||||||
rescue
|
|
||||||
e ->
|
|
||||||
{:error, e}
|
|
||||||
catch
|
|
||||||
:exit, {:timeout, _} ->
|
|
||||||
Logger.warn("Receive response from pool failed #{request[:url]}")
|
|
||||||
{:error, :recv_pool_timeout}
|
|
||||||
|
|
||||||
:exit, e ->
|
|
||||||
{:error, e}
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec request_try(Client.t(), keyword()) :: {:ok, Env.t()} | {:error, any()}
|
@spec request_try(Client.t(), keyword()) :: {:ok, Env.t()} | {:error, any()}
|
||||||
|
|
Loading…
Reference in New Issue