logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 11c520607fcb2bf5b8323d1b22b3123acf12efe1
parent 4c5b45ed73e93e6e8bcfeb527b9b398ec64c0caf
Author: feld <feld@feld.me>
Date:   Tue,  7 Nov 2023 20:45:48 +0000

Merge branch 'mailer-queue' into 'develop'

Fix digest email processing, consolidate Oban queues

See merge request pleroma/pleroma!3966

Diffstat:

Achangelog.d/digest_emails.fix1+
Mconfig/config.exs1-
Mlib/pleroma/workers/cron/digest_emails_worker.ex2+-
Mlib/pleroma/workers/cron/new_users_digest_worker.ex2+-
Apriv/repo/migrations/20231107200724_consolidate_email_queues.exs9+++++++++
5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/changelog.d/digest_emails.fix b/changelog.d/digest_emails.fix @@ -0,0 +1 @@ +Fix the processing of email digest jobs. diff --git a/config/config.exs b/config/config.exs @@ -590,7 +590,6 @@ config :pleroma, Oban, background: 5, remote_fetcher: 2, attachments_cleanup: 1, - new_users_digest: 1, mute_expire: 5 ], plugins: [Oban.Plugins.Pruner], diff --git a/lib/pleroma/workers/cron/digest_emails_worker.ex b/lib/pleroma/workers/cron/digest_emails_worker.ex @@ -7,7 +7,7 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorker do The worker to send digest emails. """ - use Oban.Worker, queue: "digest_emails" + use Oban.Worker, queue: "mailer" alias Pleroma.Config alias Pleroma.Emails diff --git a/lib/pleroma/workers/cron/new_users_digest_worker.ex b/lib/pleroma/workers/cron/new_users_digest_worker.ex @@ -9,7 +9,7 @@ defmodule Pleroma.Workers.Cron.NewUsersDigestWorker do import Ecto.Query - use Pleroma.Workers.WorkerHelper, queue: "new_users_digest" + use Pleroma.Workers.WorkerHelper, queue: "mailer" @impl Oban.Worker def perform(_job) do diff --git a/priv/repo/migrations/20231107200724_consolidate_email_queues.exs b/priv/repo/migrations/20231107200724_consolidate_email_queues.exs @@ -0,0 +1,9 @@ +defmodule Pleroma.Repo.Migrations.ConsolidateEmailQueues do + use Ecto.Migration + + def change do + execute( + "UPDATE oban_jobs SET queue = 'mailer' WHERE queue in ('digest_emails', 'new_users_digest')" + ) + end +end