ConnectionPool: fix the previous hotfix
authorrinpatch <rinpatch@sdf.org>
Sat, 5 Sep 2020 18:27:06 +0000 (21:27 +0300)
committerrinpatch <rinpatch@sdf.org>
Sat, 5 Sep 2020 18:27:06 +0000 (21:27 +0300)
I rushed the hotfix and forgot how `pop_in` actually works,
I want to die. We need some integration tests for the HTTP client

lib/pleroma/tesla/middleware/connection_pool.ex

index 049db6eb384f0aaca8c530986fb4ff6a3f5c001f..2c5a2b53be0e60d2237a57f6e2441960b9455f03 100644 (file)
@@ -32,7 +32,8 @@ defmodule Pleroma.Tesla.Middleware.ConnectionPool do
           {:ok, env} ->
             unless opts[:adapter][:body_as] == :chunks do
               ConnectionPool.release_conn(conn_pid)
-              {:ok, pop_in(env.opts[:adapter][:conn])}
+              {_, res} = pop_in(env.opts[:adapter][:conn])
+              {:ok, res}
             else
               {:ok, env}
             end