Commit 157e32a3 authored by rinpatch's avatar rinpatch
Browse files

Merge branch 'fix/oban-in-database-config' into 'develop'

remove PurgeExpiredActivity from Oban db config

See merge request !3137
parents 74179e6a 10528344
Pipeline #32855 passed with stages
in 17 minutes and 59 seconds
defmodule Pleroma.Repo.Migrations.RemovePurgeExpiredActivityWorkerFromObanConfig do
use Ecto.Migration
def change do
with %Pleroma.ConfigDB{} = config <-
Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Oban}),
crontab when is_list(crontab) <- config.value[:crontab],
index when is_integer(index) <-
Enum.find_index(crontab, fn {_, worker} ->
worker == Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker
end) do
updated_value = Keyword.put(config.value, :crontab, List.delete_at(crontab, index))
|> Ecto.Changeset.change(value: updated_value)
|> Pleroma.Repo.update()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment