bugfix for ned opened gun conn
This commit is contained in:
parent
779b991e03
commit
a4ee648c4a
@ -26,7 +26,7 @@ defmodule Pleroma.Gun.Conn do
|
||||
|
||||
defstruct conn: nil,
|
||||
gun_state: :open,
|
||||
conn_state: :init,
|
||||
conn_state: :idle,
|
||||
used_by: [],
|
||||
last_reference: 0,
|
||||
crf: 1,
|
||||
@ -62,7 +62,6 @@ defmodule Pleroma.Gun.Conn do
|
||||
conn = %Pleroma.Gun.Conn{
|
||||
conn: conn_pid,
|
||||
gun_state: :up,
|
||||
conn_state: :active,
|
||||
last_reference: :os.system_time(:second)
|
||||
}
|
||||
|
||||
|
@ -226,6 +226,7 @@ defmodule Pleroma.Pool.Connections do
|
||||
put_in(state.conns[key], %{
|
||||
conn
|
||||
| gun_state: :down,
|
||||
conn_state: :idle,
|
||||
retries: conn.retries + 1
|
||||
})
|
||||
end
|
||||
|
@ -97,6 +97,16 @@ defmodule Pleroma.Pool.ConnectionsTest do
|
||||
refute Connections.checkin(url, name)
|
||||
:ok = Conn.open(url, name)
|
||||
|
||||
%Connections{
|
||||
conns: %{
|
||||
^key => %Conn{
|
||||
gun_state: :up,
|
||||
used_by: [],
|
||||
conn_state: :idle
|
||||
}
|
||||
}
|
||||
} = Connections.get_state(name)
|
||||
|
||||
conn = Connections.checkin(url, name)
|
||||
assert is_pid(conn)
|
||||
assert Process.alive?(conn)
|
||||
|
Loading…
Reference in New Issue
Block a user