]> Entropealabs - cluster_kv.git/commitdiff
handle get's and sync if not in ready state
authorChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 22:05:56 +0000 (17:05 -0500)
committerChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 22:05:56 +0000 (17:05 -0500)
lib/cluster_kv/ring.ex

index 7b133ba4525d81d843d3667ad4b7bfbeefd24556..e2442c9743ecfece458a142cfead7029cb316df0 100644 (file)
@@ -230,12 +230,12 @@ defmodule ClusterKV.Ring do
 
   def handle_cast(_, _, sl), do: {:ok, sl, []}
 
-  def handle_info({:sync, key, value}, @ready, %SL{data: %Ring{db: db}} = sl) do
+  def handle_info({:sync, key, value}, _, %SL{data: %Ring{db: db}} = sl) do
     DB.upsert(db, key, value)
     {:ok, sl, []}
   end
 
-  def handle_info({:get_key, key, ref, node}, @ready, %SL{data: %Ring{name: n, db: db}} = sl) do
+  def handle_info({:get_key, key, ref, node}, _, %SL{data: %Ring{name: n, db: db}} = sl) do
     val = DB.get(db, key)
     send({n, node}, {:reply, val, ref})
     {:ok, sl, []}