Make indexing logs rewrite themselves
This commit is contained in:
parent
35e9192ced
commit
410c8cb765
|
@ -57,7 +57,9 @@ def run(["index"]) do
|
||||||
|> Stream.transform(0, fn objects, acc ->
|
|> Stream.transform(0, fn objects, acc ->
|
||||||
new_acc = acc + Enum.count(objects)
|
new_acc = acc + Enum.count(objects)
|
||||||
|
|
||||||
IO.puts("Indexed #{new_acc} entries")
|
# Reset to the beginning of the line and rewrite it
|
||||||
|
IO.write("\r")
|
||||||
|
IO.write("Indexed #{new_acc} entries")
|
||||||
|
|
||||||
{[objects], new_acc}
|
{[objects], new_acc}
|
||||||
end)
|
end)
|
||||||
|
@ -76,6 +78,8 @@ def run(["index"]) do
|
||||||
end,
|
end,
|
||||||
timeout: :infinity
|
timeout: :infinity
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IO.write("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
def run(["clear"]) do
|
def run(["clear"]) do
|
||||||
|
|
Loading…
Reference in New Issue