forked from AkkomaGang/akkoma
Fix export
This commit is contained in:
parent
563801716a
commit
e50314d9d3
1 changed files with 6 additions and 9 deletions
|
@ -191,16 +191,13 @@ defp write(query, dir, name, fun) do
|
||||||
counter = :counters.new(1, [])
|
counter = :counters.new(1, [])
|
||||||
|
|
||||||
query
|
query
|
||||||
|> Pleroma.RepoStreamer.chunk_stream(100)
|
|> Pleroma.Repo.chunk_stream(100)
|
||||||
|> Stream.each(fn items ->
|
|> Enum.each(fn i ->
|
||||||
Enum.each(items, fn i ->
|
with {:ok, str} <- fun.(i),
|
||||||
with {:ok, str} <- fun.(i),
|
:ok <- IO.write(file, str <> ",\n") do
|
||||||
:ok <- IO.write(file, str <> ",\n") do
|
:counters.add(counter, 1, 1)
|
||||||
:counters.add(counter, 1, 1)
|
end
|
||||||
end
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
|> Stream.run()
|
|
||||||
|
|
||||||
total = :counters.get(counter, 1)
|
total = :counters.get(counter, 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue