diff options
author | feld <feld@feld.me> | 2020-11-19 20:32:32 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2020-11-19 20:32:32 +0000 |
commit | cd1b4155d5bdf5fd758d2fc29520d36f8f7bc1f9 (patch) | |
tree | 09cc0beff68f43eba6792152ac79907de646fd14 /priv | |
parent | c8d11c306452ea36f5690ba1824434dc71bd9f95 (diff) | |
parent | 8d218ebaf5ab0b72e419068340c40a5ef9744924 (diff) | |
download | pleroma-cd1b4155d5bdf5fd758d2fc29520d36f8f7bc1f9.tar.gz pleroma-cd1b4155d5bdf5fd758d2fc29520d36f8f7bc1f9.zip |
Merge branch 'oban-jobs-to-simple-tasks' into 'develop'
Moving some background jobs into simple tasks
Closes #1790
See merge request pleroma/pleroma!3129
Diffstat (limited to 'priv')
-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 |