From a5a1a54f19a7188c06386f505895a61aa7a60cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 15 Feb 2022 20:29:58 +0100 Subject: [PATCH] Log and use more clearer name for table (#1005) --- lib/livebook/storage/ets.ex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/livebook/storage/ets.ex b/lib/livebook/storage/ets.ex index 85dd6110c..dee4d8a7b 100644 --- a/lib/livebook/storage/ets.ex +++ b/lib/livebook/storage/ets.ex @@ -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