]> Entropealabs - cluster_kv.git/commitdiff
add logging around info event
authorChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 15:09:03 +0000 (10:09 -0500)
committerChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 15:09:03 +0000 (10:09 -0500)
lib/cluster_kv/ring.ex

index 33dc42eb0aea483f4a8e4930d78f5e310167b309..d4e5dd6b8d84f003bfa41362fd569152ae80951b 100644 (file)
@@ -233,8 +233,6 @@ defmodule ClusterKV.Ring do
     {:ok, sl, []}
   end
 
-  def handle_info({:sync, _key, _v}, _, sl), do: {:ok, sl, []}
-
   def handle_info({:get_key, key, ref, node}, @ready, %SL{data: %Ring{name: n, db: db}} = sl) do
     val = DB.get(db, key)
     send({n, node}, {:reply, val, ref})
@@ -302,6 +300,11 @@ defmodule ClusterKV.Ring do
     {:ok, sl, []}
   end
 
+  def handle_info(e, s, sl) do
+    Logger.info("Unknown Info Event: #{inspect(e)} in state #{s} with data #{inspect(sl)}")
+    {:ok, sl, []}
+  end
+
   defp get_prefix(next, r, me, repls, n, ref) do
     prefix = Enum.join(next, ".")
     node = get_node(prefix, r, me, repls)