diff options
| author | feld <feld@feld.me> | 2024-07-30 16:29:48 +0000 |
|---|---|---|
| committer | feld <feld@feld.me> | 2024-07-30 16:29:48 +0000 |
| commit | f646b0554fd081c2ea28ba9a45e90033aa06f736 (patch) | |
| tree | 950fdc47602eeb85d724c9e987b07379c501d603 /priv/repo/migrations | |
| parent | 355b028c23bf977ff2006d384d2a66d2a9dfa28b (diff) | |
| parent | b50261262ebc90739b8868ca588d3a8d6ed43b7d (diff) | |
| download | pleroma-f646b0554fd081c2ea28ba9a45e90033aa06f736.tar.gz pleroma-f646b0554fd081c2ea28ba9a45e90033aa06f736.zip | |
Merge branch 'fix-migration' into 'develop'
Fix publisher job migration error
See merge request pleroma/pleroma!4198
Diffstat (limited to 'priv/repo/migrations')
| -rw-r--r-- | priv/repo/migrations/20240729163838_publisher_job_change.exs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/priv/repo/migrations/20240729163838_publisher_job_change.exs b/priv/repo/migrations/20240729163838_publisher_job_change.exs index 3449e3b3b..cbea18205 100644 --- a/priv/repo/migrations/20240729163838_publisher_job_change.exs +++ b/priv/repo/migrations/20240729163838_publisher_job_change.exs @@ -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 |
