Chase Pleroma.RepoStreamer.chunk_stream -> Pleroma.Repo.chunk_stream
authorMark Felder <feld@FreeBSD.org>
Wed, 23 Sep 2020 17:32:47 +0000 (12:32 -0500)
committerMark Felder <feld@FreeBSD.org>
Wed, 23 Sep 2020 17:32:47 +0000 (12:32 -0500)
lib/mix/tasks/pleroma/email.ex
lib/mix/tasks/pleroma/user.ex

index c0bef03861c96d2a4e596764af13af9eea6a18cd..1f543241a6da6614e99228e6694068710953606b 100644 (file)
@@ -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
index 8196e34b1dc28a6fbf6500b9fb7e4e532510d4fd..d502056005812c63425a740d95127a19d8d4f432 100644 (file)
@@ -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)