Fix export

This commit is contained in:
Egor Kislitsyn 2020-09-18 22:33:12 +04:00
parent 563801716a
commit e50314d9d3
No known key found for this signature in database
GPG Key ID: 1B49CB15B71E7805

View File

@ -191,16 +191,13 @@ defp write(query, dir, name, fun) do
counter = :counters.new(1, [])
query
|> Pleroma.RepoStreamer.chunk_stream(100)
|> Stream.each(fn items ->
Enum.each(items, fn i ->
|> 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)
end)
|> Stream.run()
total = :counters.get(counter, 1)