TransmogrifierWorker: Remove obsolete worker
This commit is contained in:
parent
2ee483ba41
commit
e17265a7a2
@ -945,28 +945,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
|
|
||||||
defp strip_internal_tags(object), do: object
|
defp strip_internal_tags(object), do: object
|
||||||
|
|
||||||
def perform(:user_upgrade, user) do
|
|
||||||
# we pass a fake user so that the followers collection is stripped away
|
|
||||||
old_follower_address = User.ap_followers(%User{nickname: user.nickname})
|
|
||||||
|
|
||||||
from(
|
|
||||||
a in Activity,
|
|
||||||
where: ^old_follower_address in a.recipients,
|
|
||||||
update: [
|
|
||||||
set: [
|
|
||||||
recipients:
|
|
||||||
fragment(
|
|
||||||
"array_replace(?,?,?)",
|
|
||||||
a.recipients,
|
|
||||||
^old_follower_address,
|
|
||||||
^user.follower_address
|
|
||||||
)
|
|
||||||
]
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|> Repo.update_all([])
|
|
||||||
end
|
|
||||||
|
|
||||||
def maybe_fix_user_url(%{"url" => url} = data) when is_map(url) do
|
def maybe_fix_user_url(%{"url" => url} = data) when is_map(url) do
|
||||||
Map.put(data, "url", url["href"])
|
Map.put(data, "url", url["href"])
|
||||||
end
|
end
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.Workers.TransmogrifierWorker do
|
|
||||||
alias Pleroma.User
|
|
||||||
|
|
||||||
use Pleroma.Workers.WorkerHelper, queue: "transmogrifier"
|
|
||||||
|
|
||||||
@impl Oban.Worker
|
|
||||||
def perform(%Job{args: %{"op" => "user_upgrade", "user_id" => user_id}}) do
|
|
||||||
user = User.get_cached_by_id(user_id)
|
|
||||||
Pleroma.Web.ActivityPub.Transmogrifier.perform(:user_upgrade, user)
|
|
||||||
end
|
|
||||||
|
|
||||||
@impl Oban.Worker
|
|
||||||
def timeout(_job), do: :timer.seconds(5)
|
|
||||||
end
|
|
Loading…
Reference in New Issue
Block a user