Treat containment failure as cancel in ReceiverWorker
This commit is contained in:
parent
88e0e6acd5
commit
d487e0160c
|
@ -12,6 +12,7 @@ def perform(%Job{args: %{"op" => "incoming_ap_doc", "params" => params}}) do
|
||||||
with {:ok, res} <- Federator.perform(:incoming_ap_doc, params) do
|
with {:ok, res} <- Federator.perform(:incoming_ap_doc, params) do
|
||||||
{:ok, res}
|
{:ok, res}
|
||||||
else
|
else
|
||||||
|
{:error, :origin_containment_failed} -> {:cancel, :origin_containment_failed}
|
||||||
{:error, {:reject, reason}} -> {:cancel, reason}
|
{:error, {:reject, reason}} -> {:cancel, reason}
|
||||||
e -> e
|
e -> e
|
||||||
end
|
end
|
||||||
|
|
|
@ -153,7 +153,7 @@ test "rejects incoming AP docs with incorrect origin" do
|
||||||
}
|
}
|
||||||
|
|
||||||
assert {:ok, job} = Federator.incoming_ap_doc(params)
|
assert {:ok, job} = Federator.incoming_ap_doc(params)
|
||||||
assert {:error, :origin_containment_failed} = ObanHelpers.perform(job)
|
assert {:cancel, :origin_containment_failed} = ObanHelpers.perform(job)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "it does not crash if MRF rejects the post" do
|
test "it does not crash if MRF rejects the post" do
|
||||||
|
|
Loading…
Reference in New Issue