diff --git a/changelog.d/digest_emails.fix b/changelog.d/digest_emails.fix new file mode 100644 index 000000000..335a24464 --- /dev/null +++ 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 index e8ae31542..ad3a98f46 100644 --- a/config/config.exs +++ b/config/config.exs @@ -590,7 +590,6 @@ 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 index 1540c1605..0292bbb3b 100644 --- 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 index 267fe2837..1c3e445aa 100644 --- 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 new file mode 100644 index 000000000..63f5af369 --- /dev/null +++ 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