From 523586c6bb7338b51940b1d681bddfe214a8fa6f Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 9 Mar 2020 09:41:37 -0500 Subject: [PATCH] for info events, handle them even if you aren't in the ready state --- lib/cluster_kv/ring.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cluster_kv/ring.ex b/lib/cluster_kv/ring.ex index f189fc0..2924bf8 100644 --- a/lib/cluster_kv/ring.ex +++ b/lib/cluster_kv/ring.ex @@ -190,7 +190,7 @@ defmodule ClusterKV.Ring do def handle_cast( {:batch, batch}, - @ready, + _, %SL{data: %Ring{name: n, ring: r, replicas: repls}} = sl ) do batches = @@ -208,7 +208,7 @@ defmodule ClusterKV.Ring do def handle_cast( {:put_wildcard, header, key, value, split_on, join, wildcard}, - @ready, + _, %SL{data: %Ring{name: n, ring: r, replicas: repls}} = sl ) do key @@ -220,7 +220,7 @@ defmodule ClusterKV.Ring do def handle_cast( {:put, key, value}, - @ready, + _, %SL{data: %Ring{name: n, ring: r, replicas: repls}} = sl ) do nodes = HashRing.key_to_nodes(r, key, repls) @@ -245,7 +245,7 @@ defmodule ClusterKV.Ring do def handle_info( {:get_wildcard, key, parts, wildcard, ref, node}, - @ready, + _, %SL{data: %Ring{name: n, db: db, node: me}} = sl ) do val = @@ -271,7 +271,7 @@ defmodule ClusterKV.Ring do {:ok, sl, []} end - def handle_info({:reply, val, ref, from}, @ready, %SL{data: %Ring{requests: reqs} = data} = sl) do + def handle_info({:reply, val, ref, from}, _, %SL{data: %Ring{requests: reqs} = data} = sl) do {requests, actions} = maybe_reply(ref, reqs, val, from) {:ok, %SL{sl | data: %Ring{data | requests: requests}}, actions} end -- 2.45.3