Log and use more clearer name for table (#1005)

This commit is contained in:
José Valim 2022-02-15 20:29:58 +01:00 committed by GitHub
parent 48f72a003a
commit a5a1a54f19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ defmodule Livebook.Storage.Ets do
"""
@behaviour Livebook.Storage
require Logger
use GenServer
@impl Livebook.Storage
@ -56,7 +57,7 @@ defmodule Livebook.Storage.Ets do
@spec config_file_path() :: Path.t()
def config_file_path() do
Path.join([Livebook.Config.data_path(), "storage.ets"])
Path.join([Livebook.Config.data_path(), "livebook_config.ets"])
end
@impl Livebook.Storage
@ -130,7 +131,12 @@ defmodule Livebook.Storage.Ets do
{:ok, tab} ->
tab
{:error, _reason} ->
{:error, reason} ->
case reason do
{:read_error, {:file_error, _, :enoent}} -> :ok
_ -> Logger.warning("Could not open up #{config_file_path()}: #{inspect(reason)}")
end
:ets.new(__MODULE__, [:protected, :duplicate_bag])
end
end