logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20200915095704_remove_background_jobs.exs (685B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.RemoveBackgroundJobs do
  5. use Ecto.Migration
  6. import Ecto.Query, only: [from: 2]
  7. def up do
  8. from(j in "oban_jobs",
  9. where:
  10. j.queue == ^"background" and
  11. fragment("?->>'op'", j.args) in ^[
  12. "fetch_data_for_activity",
  13. "media_proxy_prefetch",
  14. "media_proxy_preload"
  15. ] and
  16. j.worker == ^"Pleroma.Workers.BackgroundWorker",
  17. select: [:id]
  18. )
  19. |> Pleroma.Repo.delete_all()
  20. end
  21. def down, do: :ok
  22. end