Fix migration crashing due to Oban not running
We can use Pleroma.Repo to fetch the jobs
This commit is contained in:
parent
05d4989795
commit
1bce582f0d
@ -2,6 +2,7 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
|
|||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
|
alias Pleroma.Repo
|
||||||
import Ecto.Query
|
import Ecto.Query
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
@ -11,8 +12,7 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
|
|||||||
where: j.state in ["available", "retryable"]
|
where: j.state in ["available", "retryable"]
|
||||||
)
|
)
|
||||||
|
|
||||||
jobs =
|
jobs = Repo.all(query)
|
||||||
Oban |> Oban.config() |> Oban.Repo.all(query)
|
|
||||||
|
|
||||||
Enum.each(jobs, fn job ->
|
Enum.each(jobs, fn job ->
|
||||||
args = job.args
|
args = job.args
|
||||||
|
Loading…
Reference in New Issue
Block a user