Fix publisher job migration error

This commit is contained in:
Mark Felder 2024-07-30 11:48:10 -04:00
parent 355b028c23
commit b50261262e
2 changed files with 9 additions and 4 deletions

View file

View file

@ -16,12 +16,17 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
Enum.each(jobs, fn job -> Enum.each(jobs, fn job ->
args = job.args args = job.args
activity = Activity.get_by_ap_id(args["id"])
updated_args = Map.put(args, "activity_id", activity.id) case Activity.get_by_ap_id(args["id"]) do
nil ->
:ok
Pleroma.Workers.PublisherWorker.new(updated_args) %Activity{id: activity_id} ->
|> Oban.insert() updated_args = Map.put(args, "activity_id", activity_id)
Pleroma.Workers.PublisherWorker.new(updated_args)
|> Oban.insert()
end
end) end)
end end
end end