Merge branch 'oban-uniques' into 'develop'

Oban: more unique job constraints

See merge request pleroma/pleroma!4253
This commit is contained in:
feld 2024-09-06 16:02:06 +00:00
commit b871551d97
6 changed files with 6 additions and 5 deletions

View file

@ -0,0 +1 @@
Adjust more Oban workers to enforce unique job constraints.

View file

@ -7,7 +7,7 @@ defmodule Pleroma.Workers.ReceiverWorker do
alias Pleroma.User alias Pleroma.User
alias Pleroma.Web.Federator alias Pleroma.Web.Federator
use Oban.Worker, queue: :federator_incoming, max_attempts: 5 use Oban.Worker, queue: :federator_incoming, max_attempts: 5, unique: [period: :infinity]
@impl true @impl true

View file

@ -5,7 +5,7 @@
defmodule Pleroma.Workers.RemoteFetcherWorker do defmodule Pleroma.Workers.RemoteFetcherWorker do
alias Pleroma.Object.Fetcher alias Pleroma.Object.Fetcher
use Oban.Worker, queue: :background use Oban.Worker, queue: :background, unique: [period: :infinity]
@impl true @impl true
def perform(%Job{args: %{"op" => "fetch_remote", "id" => id} = args}) do def perform(%Job{args: %{"op" => "fetch_remote", "id" => id} = args}) do

View file

@ -7,7 +7,7 @@ defmodule Pleroma.Workers.RichMediaWorker do
alias Pleroma.Web.RichMedia.Backfill alias Pleroma.Web.RichMedia.Backfill
alias Pleroma.Web.RichMedia.Card alias Pleroma.Web.RichMedia.Card
use Oban.Worker, queue: :background, max_attempts: 3, unique: [period: 300] use Oban.Worker, queue: :background, max_attempts: 3, unique: [period: :infinity]
@impl true @impl true
def perform(%Job{args: %{"op" => "expire", "url" => url} = _args}) do def perform(%Job{args: %{"op" => "expire", "url" => url} = _args}) do

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only # SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Workers.UserRefreshWorker do defmodule Pleroma.Workers.UserRefreshWorker do
use Oban.Worker, queue: :background, max_attempts: 1, unique: [period: 300] use Oban.Worker, queue: :background, max_attempts: 1, unique: [period: :infinity]
alias Pleroma.User alias Pleroma.User

View file

@ -7,7 +7,7 @@ defmodule Pleroma.Workers.WebPusherWorker do
alias Pleroma.Repo alias Pleroma.Repo
alias Pleroma.Web.Push.Impl alias Pleroma.Web.Push.Impl
use Oban.Worker, queue: :web_push use Oban.Worker, queue: :web_push, unique: [period: :infinity]
@impl true @impl true
def perform(%Job{args: %{"op" => "web_push", "notification_id" => notification_id}}) do def perform(%Job{args: %{"op" => "web_push", "notification_id" => notification_id}}) do