aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHakaba Hitoyo <hakabahitoyo@example.com>2018-12-06 11:23:15 +0900
committerHakaba Hitoyo <hakabahitoyo@example.com>2018-12-06 11:23:15 +0900
commit27792b2d77564717e7d4063ab3524ab9e1cb1fb6 (patch)
tree5751cc8aabc3672c0d17835b3a138e2eabfc84e3 /lib
parent505d82082726aa91fc2511165a67e266ce16ec4f (diff)
downloadpleroma-27792b2d77564717e7d4063ab3524ab9e1cb1fb6.tar.gz
remove pool and timeout options which duplicate with the default
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/http/connection.ex6
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex4
-rw-r--r--lib/pleroma/web/ostatus/ostatus.ex9
-rw-r--r--lib/pleroma/web/salmon/salmon.ex7
-rw-r--r--lib/pleroma/web/websub/websub.ex5
5 files changed, 9 insertions, 22 deletions
diff --git a/lib/pleroma/http/connection.ex b/lib/pleroma/http/connection.ex
index 5e8f2aabd..66e0d0568 100644
--- a/lib/pleroma/http/connection.ex
+++ b/lib/pleroma/http/connection.ex
@@ -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 """
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 60253a715..03a607f83 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -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
diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex
index 67df354db..bc14b8785 100644
--- a/lib/pleroma/web/ostatus/ostatus.ex
+++ b/lib/pleroma/web/ostatus/ostatus.ex
@@ -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
diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex
index 97251c05e..0e2cfddd0 100644
--- a/lib/pleroma/web/salmon/salmon.ex
+++ b/lib/pleroma/web/salmon/salmon.ex
@@ -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
diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex
index 0761b5475..8cb07006f 100644
--- a/lib/pleroma/web/websub/websub.ex
+++ b/lib/pleroma/web/websub/websub.ex
@@ -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)