Use a bigger chunk size when transferring files across nodes (#2738)

This commit is contained in:
Jonatan Kłosko 2024-08-09 14:50:37 +02:00 committed by GitHub
parent acc5f20df6
commit c1fd9bc61e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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