X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fworkers%2Freceiver_worker.ex;h=9c3d8d1c2b87b096cddce3a02598e87e14a66a40;hb=ff5793198ff9068c49de12e4dfb229b9de8d38f8;hp=1b97af1a8ea8af3973428cbeb29dc2aed2ec853b;hpb=3c0c1fd2efa981f18091782434c1f0ac77462b8e;p=akkoma
diff --git a/lib/pleroma/workers/receiver_worker.ex b/lib/pleroma/workers/receiver_worker.ex
index 1b97af1a8..9c3d8d1c2 100644
--- a/lib/pleroma/workers/receiver_worker.ex
+++ b/lib/pleroma/workers/receiver_worker.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.ReceiverWorker do
@@ -9,6 +9,12 @@ defmodule Pleroma.Workers.ReceiverWorker do
@impl Oban.Worker
def perform(%Job{args: %{"op" => "incoming_ap_doc", "params" => params}}) do
- Federator.perform(:incoming_ap_doc, params)
+ with {:ok, res} <- Federator.perform(:incoming_ap_doc, params) do
+ {:ok, res}
+ else
+ {:error, :origin_containment_failed} -> {:discard, :origin_containment_failed}
+ {:error, {:reject, reason}} -> {:discard, reason}
+ e -> e
+ end
end
end