From 117e2dcde541a92a064b25a64c510d4f2bd68ba4 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 8 Mar 2020 17:05:56 -0500 Subject: [PATCH] handle get's and sync if not in ready state --- lib/cluster_kv/ring.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cluster_kv/ring.ex b/lib/cluster_kv/ring.ex index 7b133ba..e2442c9 100644 --- a/lib/cluster_kv/ring.ex +++ b/lib/cluster_kv/ring.ex @@ -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, []} -- 2.45.3