mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Merge branch 'fix/gun-nxdomain-no-error-tuple' into 'develop'
ConnectionPool: fix gun open errors being returned without an error tuple Closes #2008 See merge request pleroma/pleroma!2832
This commit is contained in:
commit
69b9c328c9
1 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@ defmodule Pleroma.Gun.ConnectionPool do
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec get_conn(URI.t(), keyword()) :: {:ok, pid()} | {:error, term()}
|
||||||
def get_conn(uri, opts) do
|
def get_conn(uri, opts) do
|
||||||
key = "#{uri.scheme}:#{uri.host}:#{uri.port}"
|
key = "#{uri.scheme}:#{uri.host}:#{uri.port}"
|
||||||
|
|
||||||
|
@ -54,12 +55,14 @@ defmodule Pleroma.Gun.ConnectionPool do
|
||||||
|
|
||||||
{:DOWN, ^ref, :process, ^worker_pid, reason} ->
|
{:DOWN, ^ref, :process, ^worker_pid, reason} ->
|
||||||
case reason do
|
case reason do
|
||||||
{:shutdown, error} -> error
|
{:shutdown, {:error, _} = error} -> error
|
||||||
|
{:shutdown, error} -> {:error, error}
|
||||||
_ -> {:error, reason}
|
_ -> {:error, reason}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec release_conn(pid()) :: :ok
|
||||||
def release_conn(conn_pid) do
|
def release_conn(conn_pid) do
|
||||||
# :ets.fun2ms(fn {_, {worker_pid, {gun_pid, _, _, _}}} when gun_pid == conn_pid ->
|
# :ets.fun2ms(fn {_, {worker_pid, {gun_pid, _, _, _}}} when gun_pid == conn_pid ->
|
||||||
# worker_pid end)
|
# worker_pid end)
|
||||||
|
|
Loading…
Reference in a new issue