X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fworkers%2Fworker_helper.ex;h=d1f90c35beb13d36d1a6684556249cddeb4c056a;hb=918a8094fc175ed71ccb7305d606fb0b221163f6;hp=b12f198d47f5772b9a856448eff129ec61a3c2aa;hpb=dd017c65a4b86501c435f5cb01804300e6b7c6dd;p=akkoma
diff --git a/lib/pleroma/workers/worker_helper.ex b/lib/pleroma/workers/worker_helper.ex
index b12f198d4..d1f90c35b 100644
--- a/lib/pleroma/workers/worker_helper.ex
+++ b/lib/pleroma/workers/worker_helper.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.WorkerHelper do
@@ -27,6 +27,11 @@ defmodule Pleroma.Workers.WorkerHelper do
queue = Keyword.fetch!(opts, :queue)
quote do
+ # Note: `max_attempts` is intended to be overridden in `new/2` call
+ use Oban.Worker,
+ queue: unquote(queue),
+ max_attempts: 1
+
def enqueue(op, params, worker_args \\ []) do
params = Map.merge(%{"op" => op}, params)
queue_atom = String.to_atom(unquote(queue))