remove pool and timeout options which duplicate with the default
authorHakaba Hitoyo <hakabahitoyo@example.com>
Thu, 6 Dec 2018 02:23:15 +0000 (11:23 +0900)
committerHakaba Hitoyo <hakabahitoyo@example.com>
Thu, 6 Dec 2018 02:23:15 +0000 (11:23 +0900)
lib/pleroma/http/connection.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/ostatus/ostatus.ex
lib/pleroma/web/salmon/salmon.ex
lib/pleroma/web/websub/websub.ex

index 5e8f2aabd1b3ed26b70ea548cae283da232962a3..66e0d056892ccc55dbb8d5a2b249b38f60dd552b 100644 (file)
@@ -3,7 +3,11 @@ defmodule Pleroma.HTTP.Connection do
   Connection for http-requests.
   """
 
-  @hackney_options [pool: :default]
+  @hackney_options [
+    pool: :default,
+    timeout: 10000,
+    recv_timeout: 20000
+  ]
   @adapter Application.get_env(:tesla, :adapter)
 
   @doc """
index 60253a715909edc9f781ba22d9957db629388c67..03a607f839c64f4996dd10f93877108160235fe5 100644 (file)
@@ -766,9 +766,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
            @httpoison.get(
              id,
              [Accept: "application/activity+json"],
-             follow_redirect: true,
-             timeout: 10000,
-             recv_timeout: 20000
+             follow_redirect: true
            ),
          {:ok, data} <- Jason.decode(body),
          :ok <- Transmogrifier.contain_origin_from_id(id, data) do
index 67df354dbb1490f16fec9a34780f0c687aa03afc..bc14b8785ad0a1de62fd2598f941ab2ce4447a8a 100644 (file)
@@ -350,11 +350,7 @@ defmodule Pleroma.Web.OStatus do
            @httpoison.get(
              url,
              [Accept: "application/atom+xml"],
-             follow_redirect: true,
-             adapter: [
-               timeout: 10000,
-               recv_timeout: 20000
-             ]
+             follow_redirect: true
            ) do
       Logger.debug("Got document from #{url}, handling...")
       handle_incoming(body)
@@ -369,8 +365,7 @@ defmodule Pleroma.Web.OStatus do
     Logger.debug("Trying to fetch #{url}")
 
     with true <- String.starts_with?(url, "http"),
-         {:ok, %{body: body}} <-
-           @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000),
+         {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true),
          {:ok, atom_url} <- get_atom_url(body) do
       fetch_activity_from_atom_url(atom_url)
     else
index 97251c05e6eb0ea42f5f25e1137ec25f24f6542b..0e2cfddd0ab7d7ec8b267ea311871f423ff0c2e0 100644 (file)
@@ -162,12 +162,7 @@ defmodule Pleroma.Web.Salmon do
            poster.(
              salmon,
              feed,
-             [{"Content-Type", "application/magic-envelope+xml"}],
-             adapter: [
-               timeout: 10000,
-               recv_timeout: 20000,
-               pool: :default
-             ]
+             [{"Content-Type", "application/magic-envelope+xml"}]
            ) do
       Logger.debug(fn -> "Pushed to #{salmon}, code #{code}" end)
     else
index 0761b54756b8e09e074da23899fff8ecde015297..8cb07006f81b9b5d6352d06348a93cabca52b7d4 100644 (file)
@@ -264,11 +264,6 @@ defmodule Pleroma.Web.Websub do
              [
                {"Content-Type", "application/atom+xml"},
                {"X-Hub-Signature", "sha1=#{signature}"}
-             ],
-             adapter: [
-               timeout: 10000,
-               recv_timeout: 20000,
-               pool: :default
              ]
            ) do
       Logger.info(fn -> "Pushed to #{callback}, code #{code}" end)