mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-27 14:25:17 +01:00
Longer timeouts for outgoing federation.
This commit is contained in:
parent
42633406b3
commit
6a184115a2
@ -132,7 +132,7 @@ defmodule Pleroma.Web.Salmon do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp send_to_user(%{info: %{"salmon" => salmon}}, feed, poster) do
|
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
|
end
|
||||||
|
|
||||||
defp send_to_user(_,_,_), do: nil
|
defp send_to_user(_,_,_), do: nil
|
||||||
|
@ -54,9 +54,9 @@ defmodule Pleroma.Web.Websub do
|
|||||||
|
|
||||||
Task.start(fn ->
|
Task.start(fn ->
|
||||||
with {:ok, %{status_code: code}} <- @httpoison.post(sub.callback, response, [
|
with {:ok, %{status_code: code}} <- @httpoison.post(sub.callback, response, [
|
||||||
{"Content-Type", "application/atom+xml"},
|
{"Content-Type", "application/atom+xml"},
|
||||||
{"X-Hub-Signature", "sha1=#{signature}"}
|
{"X-Hub-Signature", "sha1=#{signature}"}
|
||||||
]) do
|
], timeout: 10000, recv_timeout: 20000) do
|
||||||
Logger.debug(fn -> "Pushed to #{sub.callback}, code #{code}" end)
|
Logger.debug(fn -> "Pushed to #{sub.callback}, code #{code}" end)
|
||||||
else e ->
|
else e ->
|
||||||
Logger.debug(fn -> "Couldn't push to #{sub.callback}, #{inspect(e)}" end)
|
Logger.debug(fn -> "Couldn't push to #{sub.callback}, #{inspect(e)}" end)
|
||||||
|
@ -84,7 +84,7 @@ defmodule Pleroma.Web.Salmon.SalmonTest do
|
|||||||
user = Repo.get_by(User, ap_id: activity.data["actor"])
|
user = Repo.get_by(User, ap_id: activity.data["actor"])
|
||||||
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
|
{: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"
|
assert url == "http://example.org/salmon"
|
||||||
end
|
end
|
||||||
Salmon.publish(user, activity, poster)
|
Salmon.publish(user, activity, poster)
|
||||||
|
Loading…
Reference in New Issue
Block a user