mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-03-14 00:36:41 +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
|
||||
restored_file_systems =
|
||||
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 ->
|
||||
{fs_id, storage_to_fs(raw_fs)}
|
||||
end)
|
||||
|
@ -53,10 +53,7 @@ defmodule Livebook.Settings do
|
|||
id = Livebook.Utils.random_short_id()
|
||||
|
||||
:ok =
|
||||
storage().insert(:filesystem, id, [
|
||||
{:type, "s3"},
|
||||
{:order, System.monotonic_time()} | attributes
|
||||
])
|
||||
storage().insert(:filesystem, id, [{:type, "s3"}, {:order, System.os_time()} | attributes])
|
||||
|
||||
id
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue