logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 1e8d1904e61c73f624bdce600fc243dff81e19fc
parent 0ea63d824e6381723ad99e544fd8b08ea9d721fd
Author: Mark Felder <feld@feld.me>
Date:   Mon, 15 Jul 2024 10:15:23 -0400

Define missing Oban timeouts

Diffstat:

Achangelog.d/oban-timeouts.change1+
Mlib/pleroma/workers/cron/digest_emails_worker.ex3+++
Mlib/pleroma/workers/cron/new_users_digest_worker.ex3+++
Mlib/pleroma/workers/rich_media_worker.ex3+++
Mlib/pleroma/workers/search_indexing_worker.ex3+++
Mlib/pleroma/workers/user_refresh_worker.ex3+++
6 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/changelog.d/oban-timeouts.change b/changelog.d/oban-timeouts.change @@ -0,0 +1 @@ +Ensure all Oban jobs have timeouts defined diff --git a/lib/pleroma/workers/cron/digest_emails_worker.ex b/lib/pleroma/workers/cron/digest_emails_worker.ex @@ -58,4 +58,7 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorker do User.touch_last_digest_emailed_at(user) end + + @impl Oban.Worker + def timeout(_job), do: :timer.seconds(5) end diff --git a/lib/pleroma/workers/cron/new_users_digest_worker.ex b/lib/pleroma/workers/cron/new_users_digest_worker.ex @@ -60,4 +60,7 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do :ok end + + @impl Oban.Worker + def timeout(_job), do: :timer.seconds(5) end diff --git a/lib/pleroma/workers/rich_media_worker.ex b/lib/pleroma/workers/rich_media_worker.ex @@ -16,4 +16,7 @@ defmodule Pleroma.Workers.RichMediaWorker do def perform(%Job{args: %{"op" => "backfill", "url" => _url} = args}) do Backfill.run(args) end + + @impl Oban.Worker + def timeout(_job), do: :timer.seconds(5) end diff --git a/lib/pleroma/workers/search_indexing_worker.ex b/lib/pleroma/workers/search_indexing_worker.ex @@ -20,4 +20,7 @@ defmodule Pleroma.Workers.SearchIndexingWorker do search_module.remove_from_index(object) end + + @impl Oban.Worker + def timeout(_job), do: :timer.seconds(5) end diff --git a/lib/pleroma/workers/user_refresh_worker.ex b/lib/pleroma/workers/user_refresh_worker.ex @@ -11,4 +11,7 @@ defmodule Pleroma.Workers.UserRefreshWorker do def perform(%Job{args: %{"ap_id" => ap_id}}) do User.fetch_by_ap_id(ap_id) end + + @impl Oban.Worker + def timeout(_job), do: :timer.seconds(5) end