diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-11-13 09:07:08 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-11-13 09:07:08 +0300 |
commit | 10528344c7c56c70dcfc09a72ff5f109f7b952fe (patch) | |
tree | 78d8e1c1a7c8b9280a24b160c9b3fe161828145e | |
parent | 74179e6ac365dbbfbc08590a03def4b5a69b22e6 (diff) | |
download | pleroma-10528344c7c56c70dcfc09a72ff5f109f7b952fe.tar.gz |
remove PurgeExpiredActivity from Oban db config
-rw-r--r-- | priv/repo/migrations/20201113060459_remove_purge_expired_activity_worker_from_oban_config.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/priv/repo/migrations/20201113060459_remove_purge_expired_activity_worker_from_oban_config.exs b/priv/repo/migrations/20201113060459_remove_purge_expired_activity_worker_from_oban_config.exs new file mode 100644 index 000000000..fe31f4442 --- /dev/null +++ b/priv/repo/migrations/20201113060459_remove_purge_expired_activity_worker_from_oban_config.exs @@ -0,0 +1,19 @@ +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)) + + config + |> Ecto.Changeset.change(value: updated_value) + |> Pleroma.Repo.update() + end + end +end |