Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
696B

  1. defmodule Pleroma.Repo.Migrations.RemovePurgeExpiredActivityWorkerFromObanConfig do
  2. use Ecto.Migration
  3. def change do
  4. with %Pleroma.ConfigDB{} = config <-
  5. Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Oban}),
  6. crontab when is_list(crontab) <- config.value[:crontab],
  7. index when is_integer(index) <-
  8. Enum.find_index(crontab, fn {_, worker} ->
  9. worker == Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker
  10. end) do
  11. updated_value = Keyword.put(config.value, :crontab, List.delete_at(crontab, index))
  12. config
  13. |> Ecto.Changeset.change(value: updated_value)
  14. |> Pleroma.Repo.update()
  15. end
  16. end
  17. end