Commit 8228ae96 authored by lain's avatar lain

Only run the fix-up tasks once.

parent a91adb14
Pipeline #879 passed with stage
in 2 minutes and 30 seconds
......@@ -266,16 +266,19 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
data = data
|> Map.put(:info, Map.merge(user.info, data[:info]))
already_ap = User.ap_enabled?(user)
{:ok, user} = User.upgrade_changeset(user, data)
|> Repo.update()
# This could potentially take a long time, do it in the background
if async do
Task.start(fn ->
if !already_ap do
# This could potentially take a long time, do it in the background
if async do
Task.start(fn ->
user_upgrade_task(user)
end)
else
user_upgrade_task(user)
end)
else
user_upgrade_task(user)
end
end
{:ok, user}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment