summaryrefslogtreecommitdiff
path: root/lib/pleroma/workers/publisher.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/workers/publisher.ex')
-rw-r--r--lib/pleroma/workers/publisher.ex14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/pleroma/workers/publisher.ex b/lib/pleroma/workers/publisher.ex
new file mode 100644
index 000000000..639794830
--- /dev/null
+++ b/lib/pleroma/workers/publisher.ex
@@ -0,0 +1,14 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Workers.Publisher do
+ use Oban.Worker, queue: "federator_outgoing", max_attempts: 5
+
+ @impl Oban.Worker
+ def perform(%Oban.Job{args: %{module: module_name, params: params}}) do
+ module_name
+ |> String.to_atom()
+ |> apply(:publish_one, [params])
+ end
+end