mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 13:34:55 +08:00
Enable :sync mode when writing to the local file system (#1378)
This ensures we always flush changes right away when saving a notebook. This is important for Nerves Livebook, where it is more likely the device is stopped abruptly.
This commit is contained in:
parent
2024187226
commit
e14fbdb616
1 changed files with 1 additions and 1 deletions
|
@ -102,7 +102,7 @@ defimpl Livebook.FileSystem, for: Livebook.FileSystem.Local do
|
|||
|
||||
with :ok <- ensure_local(file_system) do
|
||||
with :ok <- File.mkdir_p(dir),
|
||||
:ok <- File.write(path, content) do
|
||||
:ok <- File.write(path, content, [:sync]) do
|
||||
:ok
|
||||
else
|
||||
{:error, error} -> FileSystem.Utils.posix_error(error)
|
||||
|
|
Loading…
Add table
Reference in a new issue