[#582] Optimized federation retirement by reducing the number of SQL calls

(calling `Instances.set_reachable/1` only if instance had `unreachable_since`,
calling `Instances.set_unreachable/1` only if instance had nil `unreachable_since`).
This commit is contained in:
Ivan Tashkinov 2019-02-03 12:41:27 +03:00
commit b40b4bc4e5
7 changed files with 74 additions and 35 deletions

View file

@ -163,8 +163,8 @@ defmodule Pleroma.Web.FederatorTest do
{:ok, _activity} =
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
assert called(Federator.enqueue(:publish_single_salmon, {remote_user2, :_, :_}))
refute called(Federator.enqueue(:publish_single_websub, {remote_user1, :_, :_}))
assert called(Federator.enqueue(:publish_single_salmon, %{recipient: remote_user2}))
refute called(Federator.enqueue(:publish_single_websub, %{recipient: remote_user1}))
end
end