mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-13 23:16:03 +08:00
Use System.os_time/0 for ordering file systems
This commit is contained in:
parent
4fcdeb6bcf
commit
4f61639fba
1 changed files with 2 additions and 5 deletions
|
@ -32,7 +32,7 @@ defmodule Livebook.Settings do
|
||||||
def file_systems() do
|
def file_systems() do
|
||||||
restored_file_systems =
|
restored_file_systems =
|
||||||
storage().all(:filesystem)
|
storage().all(:filesystem)
|
||||||
|> Enum.sort_by(&Map.get(&1, :order, System.monotonic_time()))
|
|> Enum.sort_by(&Map.get(&1, :order, System.os_time()))
|
||||||
|> Enum.map(fn %{id: fs_id} = raw_fs ->
|
|> Enum.map(fn %{id: fs_id} = raw_fs ->
|
||||||
{fs_id, storage_to_fs(raw_fs)}
|
{fs_id, storage_to_fs(raw_fs)}
|
||||||
end)
|
end)
|
||||||
|
@ -53,10 +53,7 @@ defmodule Livebook.Settings do
|
||||||
id = Livebook.Utils.random_short_id()
|
id = Livebook.Utils.random_short_id()
|
||||||
|
|
||||||
:ok =
|
:ok =
|
||||||
storage().insert(:filesystem, id, [
|
storage().insert(:filesystem, id, [{:type, "s3"}, {:order, System.os_time()} | attributes])
|
||||||
{:type, "s3"},
|
|
||||||
{:order, System.monotonic_time()} | attributes
|
|
||||||
])
|
|
||||||
|
|
||||||
id
|
id
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue