moving some logic to tesla adapter
- checking original inside gun adapter - flushing streams on max_body error
This commit is contained in:
parent
22d52f5691
commit
d6bebd4f9c
6 changed files with 6 additions and 34 deletions
|
|
@ -28,12 +28,7 @@ defmodule Pleroma.Pool.Request do
|
|||
end
|
||||
|
||||
@impl true
|
||||
def handle_info({:gun_data, _conn, stream, _, _}, state) do
|
||||
# in some cases if we reuse conn and got {:error, :body_too_large}
|
||||
# gun continues to send messages to this process,
|
||||
# so we flush messages for this request
|
||||
:ok = :gun.flush(stream)
|
||||
|
||||
def handle_info({:gun_data, _conn, _stream, _, _}, state) do
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
|
|
@ -49,8 +44,7 @@ defmodule Pleroma.Pool.Request do
|
|||
end
|
||||
|
||||
@impl true
|
||||
def handle_info({:gun_error, _conn, stream, _error}, state) do
|
||||
:ok = :gun.flush(stream)
|
||||
def handle_info({:gun_error, _conn, _stream, _error}, state) do
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue