formatting and pool fix
This commit is contained in:
parent
b8ee025792
commit
70c4f00349
@ -112,8 +112,8 @@ defmodule Pleroma.Gun.Connections do
|
|||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_info({:gun_down, conn_pid, _protocol, _reason, _killed, _unprocessed}, state) do
|
def handle_info({:gun_down, conn_pid, _protocol, _reason, _killed, _unprocessed}, state) do
|
||||||
conn_key = compose_key_gun_info(conn_pid)
|
# we can't get info on this pid, because pid is dead
|
||||||
{key, conn} = find_conn(state.conns, conn_pid, conn_key)
|
{key, conn} = find_conn(state.conns, conn_pid)
|
||||||
|
|
||||||
Enum.each(conn.waiting_pids, fn waiting_pid -> GenServer.reply(waiting_pid, nil) end)
|
Enum.each(conn.waiting_pids, fn waiting_pid -> GenServer.reply(waiting_pid, nil) end)
|
||||||
|
|
||||||
@ -128,6 +128,12 @@ defmodule Pleroma.Gun.Connections do
|
|||||||
"#{info.origin_scheme}:#{info.origin_host}:#{info.origin_port}"
|
"#{info.origin_scheme}:#{info.origin_host}:#{info.origin_port}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp find_conn(conns, conn_pid) do
|
||||||
|
Enum.find(conns, fn {_key, conn} ->
|
||||||
|
conn.conn == conn_pid
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
defp find_conn(conns, conn_pid, conn_key) do
|
defp find_conn(conns, conn_pid, conn_key) do
|
||||||
Enum.find(conns, fn {key, conn} ->
|
Enum.find(conns, fn {key, conn} ->
|
||||||
key == conn_key and conn.conn == conn_pid
|
key == conn_key and conn.conn == conn_pid
|
||||||
|
@ -91,7 +91,8 @@ defmodule Pleroma.HTTP do
|
|||||||
"https" ->
|
"https" ->
|
||||||
adapter_opts = Keyword.get(options, :adapter, [])
|
adapter_opts = Keyword.get(options, :adapter, [])
|
||||||
|
|
||||||
tls_opts = Keyword.get(adapter_opts, :tls_opts, [])
|
tls_opts =
|
||||||
|
Keyword.get(adapter_opts, :tls_opts, [])
|
||||||
|> Keyword.put(:server_name_indication, host)
|
|> Keyword.put(:server_name_indication, host)
|
||||||
|
|
||||||
adapter_opts = Keyword.put(adapter_opts, :tls_opts, tls_opts)
|
adapter_opts = Keyword.put(adapter_opts, :tls_opts, tls_opts)
|
||||||
|
@ -555,7 +555,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
|
|||||||
note_two = insert(:note, data: %{"context" => "suya.."})
|
note_two = insert(:note, data: %{"context" => "suya.."})
|
||||||
activity_two = insert(:note_activity, note: note_two)
|
activity_two = insert(:note_activity, note: note_two)
|
||||||
|
|
||||||
{:ok, activity_two} = CommonAPI.add_mute(user, activity_two)
|
{:ok, _activity_two} = CommonAPI.add_mute(user, activity_two)
|
||||||
|
|
||||||
assert [_activity_two, _activity_one] =
|
assert [_activity_two, _activity_one] =
|
||||||
ActivityPub.fetch_activities([], %{"muting_user" => user, "with_muted" => true})
|
ActivityPub.fetch_activities([], %{"muting_user" => user, "with_muted" => true})
|
||||||
|
Loading…
Reference in New Issue
Block a user