X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fworkers%2Freceiver_worker.ex;h=9c3d8d1c2b87b096cddce3a02598e87e14a66a40;hb=ff5793198ff9068c49de12e4dfb229b9de8d38f8;hp=f7a7124f39c98afcbd1572c17274557374e3c459;hpb=e8493431bfc16977e43715bf8bdb09ac46580028;p=akkoma
diff --git a/lib/pleroma/workers/receiver_worker.ex b/lib/pleroma/workers/receiver_worker.ex
index f7a7124f3..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
@@ -8,7 +8,13 @@ defmodule Pleroma.Workers.ReceiverWorker do
use Pleroma.Workers.WorkerHelper, queue: "federator_incoming"
@impl Oban.Worker
- def perform(%{"op" => "incoming_ap_doc", "params" => params}, _job) do
- Federator.perform(:incoming_ap_doc, params)
+ 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} -> {:discard, :origin_containment_failed}
+ {:error, {:reject, reason}} -> {:discard, reason}
+ e -> e
+ end
end
end