Merge branch 'chores/bump-copyright' into 'develop'
[akkoma] / lib / pleroma / tesla / middleware / connection_pool.ex
index 049db6eb384f0aaca8c530986fb4ff6a3f5c001f..906706d39a45b1817782e08ab38a7b21ab76e138 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Tesla.Middleware.ConnectionPool do
@@ -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
@@ -41,6 +42,9 @@ defmodule Pleroma.Tesla.Middleware.ConnectionPool do
             ConnectionPool.release_conn(conn_pid)
             err
         end
+
+      err ->
+        err
     end
   end
 end