Skip to content

Commit f646b05

Browse files
committed
Merge branch 'fix-migration' into 'develop'
Fix publisher job migration error See merge request pleroma/pleroma!4198
2 parents 355b028 + b502612 commit f646b05

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

changelog.d/fix-migration.skip

Whitespace-only changes.

priv/repo/migrations/20240729163838_publisher_job_change.exs

+9-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ defmodule Pleroma.Repo.Migrations.PublisherJobChange do
1616

1717
Enum.each(jobs, fn job ->
1818
args = job.args
19-
activity = Activity.get_by_ap_id(args["id"])
2019

21-
updated_args = Map.put(args, "activity_id", activity.id)
20+
case Activity.get_by_ap_id(args["id"]) do
21+
nil ->
22+
:ok
2223

23-
Pleroma.Workers.PublisherWorker.new(updated_args)
24-
|> Oban.insert()
24+
%Activity{id: activity_id} ->
25+
updated_args = Map.put(args, "activity_id", activity_id)
26+
27+
Pleroma.Workers.PublisherWorker.new(updated_args)
28+
|> Oban.insert()
29+
end
2530
end)
2631
end
2732
end

0 commit comments

Comments
 (0)