[#534] Various tweaks. Tests for Instances and Instance.

This commit is contained in:
Ivan Tashkinov 2019-01-28 15:25:06 +03:00
commit 1d2f41642c
15 changed files with 312 additions and 40 deletions

View file

@ -286,14 +286,10 @@ defmodule Pleroma.Web.Websub do
Logger.info(fn -> "Pushed to #{callback}, code #{code}" end)
{:ok, code}
else
{:reachable, false} ->
Logger.debug(fn -> "Pushing to #{callback} skipped as marked unreachable)" end)
{:error, :noop}
e ->
{_post_result, response} ->
Instances.set_unreachable(callback)
Logger.debug(fn -> "Couldn't push to #{callback}, #{inspect(e)}" end)
{:error, e}
Logger.debug(fn -> "Couldn't push to #{callback}, #{inspect(response)}" end)
{:error, response}
end
end
end