From: Mark Felder Date: Wed, 23 Sep 2020 17:32:47 +0000 (-0500) Subject: Chase Pleroma.RepoStreamer.chunk_stream -> Pleroma.Repo.chunk_stream X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8af8eb5ce79a35e01415763164533c537e017776;p=akkoma Chase Pleroma.RepoStreamer.chunk_stream -> Pleroma.Repo.chunk_stream --- diff --git a/lib/mix/tasks/pleroma/email.ex b/lib/mix/tasks/pleroma/email.ex index c0bef0386..1f543241a 100644 --- a/lib/mix/tasks/pleroma/email.ex +++ b/lib/mix/tasks/pleroma/email.ex @@ -31,11 +31,8 @@ defmodule Mix.Tasks.Pleroma.Email do confirmation_pending: true, invisible: false }) - |> Pleroma.RepoStreamer.chunk_stream(500) - |> Stream.each(fn users -> - users - |> Enum.each(fn user -> Pleroma.User.try_send_confirmation_email(user) end) - end) + |> Pleroma.Repo.chunk_stream(500, :batches) + |> Stream.each(&Pleroma.User.try_send_confirmation_email(&1)) |> Stream.run() end end diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index 8196e34b1..d50205600 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -370,7 +370,7 @@ defmodule Mix.Tasks.Pleroma.User do is_admin: false, invisible: false }) - |> Pleroma.RepoStreamer.chunk_stream(500) + |> Pleroma.Repo.chunk_stream(500, :batches) |> Stream.each(fn users -> users |> Enum.each(fn user -> User.need_confirmation(user, false) end) @@ -388,7 +388,7 @@ defmodule Mix.Tasks.Pleroma.User do is_admin: false, invisible: false }) - |> Pleroma.RepoStreamer.chunk_stream(500) + |> Pleroma.Repo.chunk_stream(500, :batches) |> Stream.each(fn users -> users |> Enum.each(fn user -> User.need_confirmation(user, true) end)