forked from AkkomaGang/akkoma
Only run the fix-up tasks once.
This commit is contained in:
parent
a91adb146e
commit
8228ae96d8
1 changed files with 9 additions and 6 deletions
|
@ -266,9 +266,11 @@ def upgrade_user_from_ap_id(ap_id, async \\ true) 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()
|
||||
|
||||
if !already_ap do
|
||||
# This could potentially take a long time, do it in the background
|
||||
if async do
|
||||
Task.start(fn ->
|
||||
|
@ -277,6 +279,7 @@ def upgrade_user_from_ap_id(ap_id, async \\ true) do
|
|||
else
|
||||
user_upgrade_task(user)
|
||||
end
|
||||
end
|
||||
|
||||
{:ok, user}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue