diff options
| author | Alex Gleason <alex@alexgleason.me> | 2020-11-21 10:23:53 -0600 |
|---|---|---|
| committer | Alex Gleason <alex@alexgleason.me> | 2020-11-21 10:23:53 -0600 |
| commit | 30ed7b502f5db14a4635d3d80a62df3c18b91813 (patch) | |
| tree | 84a76b9881e8545a6afc472c9c97b044735e248c /priv/repo/migrations | |
| parent | 9546c1444c2c8c4abc9bcb35b6a8ff360ddc83af (diff) | |
| parent | ecd1ef8cb5afa16dba5158e9e278a18c0856ca3e (diff) | |
| download | pleroma-30ed7b502f5db14a4635d3d80a62df3c18b91813.tar.gz pleroma-30ed7b502f5db14a4635d3d80a62df3c18b91813.zip | |
Merge remote-tracking branch 'upstream/develop' into registration-workflow
Diffstat (limited to 'priv/repo/migrations')
| -rw-r--r-- | priv/repo/migrations/20200915095704_remove_background_jobs.exs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200915095704_remove_background_jobs.exs b/priv/repo/migrations/20200915095704_remove_background_jobs.exs new file mode 100644 index 000000000..9785bfb8a --- /dev/null +++ b/priv/repo/migrations/20200915095704_remove_background_jobs.exs @@ -0,0 +1,22 @@ +defmodule Pleroma.Repo.Migrations.RemoveBackgroundJobs do + use Ecto.Migration + + import Ecto.Query, only: [from: 2] + + def up do + from(j in "oban_jobs", + where: + j.queue == ^"background" and + fragment("?->>'op'", j.args) in ^[ + "fetch_data_for_activity", + "media_proxy_prefetch", + "media_proxy_preload" + ] and + j.worker == ^"Pleroma.Workers.BackgroundWorker", + select: [:id] + ) + |> Pleroma.Repo.delete_all() + end + + def down, do: :ok +end |
