Fix export
authorEgor Kislitsyn <egor@kislitsyn.com>
Fri, 18 Sep 2020 18:33:12 +0000 (22:33 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Wed, 7 Oct 2020 14:35:26 +0000 (18:35 +0400)
lib/pleroma/backup.ex

index d589f12f1beac02e04dae7077b5ab52e89435a58..242773bdbe8bf1af61fbef94f5396ac49de31179 100644 (file)
@@ -191,16 +191,13 @@ defmodule Pleroma.Backup do
       counter = :counters.new(1, [])
 
       query
-      |> Pleroma.RepoStreamer.chunk_stream(100)
-      |> Stream.each(fn items ->
-        Enum.each(items, fn i ->
-          with {:ok, str} <- fun.(i),
-               :ok <- IO.write(file, str <> ",\n") do
-            :counters.add(counter, 1, 1)
-          end
-        end)
+      |> Pleroma.Repo.chunk_stream(100)
+      |> Enum.each(fn i ->
+        with {:ok, str} <- fun.(i),
+             :ok <- IO.write(file, str <> ",\n") do
+          :counters.add(counter, 1, 1)
+        end
       end)
-      |> Stream.run()
 
       total = :counters.get(counter, 1)