From fe27b61a726ecf328a58ecab1f31434770dfd748 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Tue, 20 Jun 2017 14:10:44 +0200 Subject: [PATCH] Add some debugging to federations. --- lib/pleroma/web/websub/websub.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/websub/websub.ex b/lib/pleroma/web/websub/websub.ex index a683f6da4..12edf094c 100644 --- a/lib/pleroma/web/websub/websub.ex +++ b/lib/pleroma/web/websub/websub.ex @@ -53,10 +53,14 @@ defmodule Pleroma.Web.Websub do Logger.debug(fn -> "Pushing to #{sub.callback}" end) Task.start(fn -> - @httpoison.post(sub.callback, response, [ + with {:ok, %{status_code: code}} <- @httpoison.post(sub.callback, response, [ {"Content-Type", "application/atom+xml"}, {"X-Hub-Signature", "sha1=#{signature}"} - ]) + ]) 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) + end end) end) end