logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 6a184115a2431727b5039c1c726a8afc5eef228c
parent: 42633406b333b26e5b364cdd2c93899a0d6d0bad
Author: Roger Braun <roger@rogerbraun.net>
Date:   Fri, 23 Jun 2017 12:25:53 +0200

Longer timeouts for outgoing federation.

Diffstat:

Mlib/pleroma/web/salmon/salmon.ex2+-
Mlib/pleroma/web/websub/websub.ex6+++---
Mtest/web/salmon/salmon_test.exs2+-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex @@ -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 diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex @@ -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) diff --git a/test/web/salmon/salmon_test.exs b/test/web/salmon/salmon_test.exs @@ -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)