Longer timeouts for outgoing federation.
authorRoger Braun <roger@rogerbraun.net>
Fri, 23 Jun 2017 10:25:53 +0000 (12:25 +0200)
committerRoger Braun <roger@rogerbraun.net>
Fri, 23 Jun 2017 10:25:53 +0000 (12:25 +0200)
lib/pleroma/web/salmon/salmon.ex
lib/pleroma/web/websub/websub.ex
test/web/salmon/salmon_test.exs

index b4f81b4edfdf41a7e80472f431b77a1e78bc71ac..e2eff857fa8cd33e92d521a94ce1c1afb2168f18 100644 (file)
@@ -132,7 +132,7 @@ defmodule Pleroma.Web.Salmon do
   end
 
   defp send_to_user(%{info: %{"salmon" => salmon}}, feed, poster) do
-    poster.(salmon, feed, [{"Content-Type", "application/magic-envelope+xml"}])
+    poster.(salmon, feed, [{"Content-Type", "application/magic-envelope+xml"}], timeout: 10000, recv_timeout: 20000)
   end
 
   defp send_to_user(_,_,_), do: nil
index 410303b7708620a5941c9b67ea69081ef04f2909..a5309ebd99428fee662b07a9b98e17633e487346 100644 (file)
@@ -54,9 +54,9 @@ defmodule Pleroma.Web.Websub do
 
       Task.start(fn ->
         with {:ok, %{status_code: code}} <- @httpoison.post(sub.callback, response, [
-              {"Content-Type", "application/atom+xml"},
-              {"X-Hub-Signature", "sha1=#{signature}"}
-                    ]) do
+          {"Content-Type", "application/atom+xml"},
+          {"X-Hub-Signature", "sha1=#{signature}"}
+        ], timeout: 10000, recv_timeout: 20000) do
           Logger.debug(fn -> "Pushed to #{sub.callback}, code #{code}" end)
         else e ->
             Logger.debug(fn -> "Couldn't push to #{sub.callback}, #{inspect(e)}" end)
index 65d81e44fc923bb024571d5ea2adac2894419afe..e722f08efb85a562fac6739e2e1d188f456948c9 100644 (file)
@@ -84,7 +84,7 @@ defmodule Pleroma.Web.Salmon.SalmonTest do
     user = Repo.get_by(User, ap_id: activity.data["actor"])
     {:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
 
-    poster = fn (url, data, headers) ->
+    poster = fn (url, data, headers, options) ->
       assert url == "http://example.org/salmon"
     end
     Salmon.publish(user, activity, poster)