mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 21:16:26 +08:00
Log and use more clearer name for table (#1005)
This commit is contained in:
parent
48f72a003a
commit
a5a1a54f19
1 changed files with 8 additions and 2 deletions
|
@ -10,6 +10,7 @@ defmodule Livebook.Storage.Ets do
|
||||||
"""
|
"""
|
||||||
@behaviour Livebook.Storage
|
@behaviour Livebook.Storage
|
||||||
|
|
||||||
|
require Logger
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
||||||
@impl Livebook.Storage
|
@impl Livebook.Storage
|
||||||
|
@ -56,7 +57,7 @@ defmodule Livebook.Storage.Ets do
|
||||||
|
|
||||||
@spec config_file_path() :: Path.t()
|
@spec config_file_path() :: Path.t()
|
||||||
def config_file_path() do
|
def config_file_path() do
|
||||||
Path.join([Livebook.Config.data_path(), "storage.ets"])
|
Path.join([Livebook.Config.data_path(), "livebook_config.ets"])
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl Livebook.Storage
|
@impl Livebook.Storage
|
||||||
|
@ -130,7 +131,12 @@ defmodule Livebook.Storage.Ets do
|
||||||
{:ok, tab} ->
|
{:ok, tab} ->
|
||||||
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])
|
:ets.new(__MODULE__, [:protected, :duplicate_bag])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue