Enum.map(lines, fn line ->
String.split(line, ",") |> List.first()
end)
- |> List.delete("Account address"),
- {:ok, _} = Task.start(fn -> User.follow_import(follower, followed_identifiers) end) do
+ |> List.delete("Account address") do
+ PleromaJobQueue.enqueue(:background, User, [
+ :follow_import,
+ follower,
+ followed_identifiers
+ ])
+
json(conn, "job started")
end
end
end
def blocks_import(%{assigns: %{user: blocker}} = conn, %{"list" => list}) do
- with blocked_identifiers <- String.split(list),
- {:ok, _} = Task.start(fn -> User.blocks_import(blocker, blocked_identifiers) end) do
+ with blocked_identifiers <- String.split(list) do
+ PleromaJobQueue.enqueue(:background, User, [
+ :blocks_import,
+ blocker,
+ blocked_identifiers
+ ])
+
json(conn, "job started")
end
end