Treat containment failure as cancel in ReceiverWorker
This commit is contained in:
parent
20ad2c10a6
commit
7e47f914e5
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
{:ok, res}
|
||||
else
|
||||
{:error, :origin_containment_failed} -> {:cancel, :origin_containment_failed}
|
||||
{:error, {:reject, reason}} -> {:cancel, reason}
|
||||
e -> e
|
||||
end
|
||||
|
|
|
@ -153,7 +153,7 @@ test "rejects incoming AP docs with incorrect origin" do
|
|||
}
|
||||
|
||||
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
|
||||
|
||||
test "it does not crash if MRF rejects the post" do
|
||||
|
|
Loading…
Reference in a new issue