mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-22 16:16:34 +00:00
Merge branch 'fix-migration' into 'develop'
Fix publisher job migration error See merge request pleroma/pleroma!4198
This commit is contained in:
commit
f646b0554f
2 changed files with 9 additions and 4 deletions
0
changelog.d/fix-migration.skip
Normal file
0
changelog.d/fix-migration.skip
Normal file
|
@ -16,12 +16,17 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
|
|||
|
||||
Enum.each(jobs, fn job ->
|
||||
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)
|
||||
|> Oban.insert()
|
||||
%Activity{id: activity_id} ->
|
||||
updated_args = Map.put(args, "activity_id", activity_id)
|
||||
|
||||
Pleroma.Workers.PublisherWorker.new(updated_args)
|
||||
|> Oban.insert()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue