mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Use a bigger chunk size when transferring files across nodes (#2738)
This commit is contained in:
parent
acc5f20df6
commit
c1fd9bc61e
|
@ -177,7 +177,7 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
|||
{:transfer, target_path, target_pid} ->
|
||||
try do
|
||||
path
|
||||
|> File.stream!(2048, [])
|
||||
|> File.stream!(64_000, [])
|
||||
|> Enum.each(fn chunk -> IO.binwrite(target_pid, chunk) end)
|
||||
|
||||
target_path
|
||||
|
|
|
@ -304,7 +304,7 @@ defmodule LivebookWeb.SessionController do
|
|||
|
||||
defp transfer_file!(remote_node, remote_path, local_path) do
|
||||
File.mkdir_p!(Path.dirname(local_path))
|
||||
remote_stream = :erpc.call(remote_node, File, :stream!, [remote_path, 2048, []])
|
||||
remote_stream = :erpc.call(remote_node, File, :stream!, [remote_path, 64_000, []])
|
||||
local_stream = File.stream!(local_path)
|
||||
Enum.into(remote_stream, local_stream)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue