mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-11-11 14:42:39 +08:00
Use a bigger chunk size when transferring files across nodes (#2738)
This commit is contained in:
parent
29ca926f39
commit
d78b98455a
2 changed files with 2 additions and 2 deletions
|
|
@ -177,7 +177,7 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
||||||
{:transfer, target_path, target_pid} ->
|
{:transfer, target_path, target_pid} ->
|
||||||
try do
|
try do
|
||||||
path
|
path
|
||||||
|> File.stream!(2048, [])
|
|> File.stream!(64_000, [])
|
||||||
|> Enum.each(fn chunk -> IO.binwrite(target_pid, chunk) end)
|
|> Enum.each(fn chunk -> IO.binwrite(target_pid, chunk) end)
|
||||||
|
|
||||||
target_path
|
target_path
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ defmodule LivebookWeb.SessionController do
|
||||||
|
|
||||||
defp transfer_file!(remote_node, remote_path, local_path) do
|
defp transfer_file!(remote_node, remote_path, local_path) do
|
||||||
File.mkdir_p!(Path.dirname(local_path))
|
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)
|
local_stream = File.stream!(local_path)
|
||||||
Enum.into(remote_stream, local_stream)
|
Enum.into(remote_stream, local_stream)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue