From: Christopher Date: Mon, 9 Mar 2020 14:41:37 +0000 (-0500) Subject: for info events, handle them even if you aren't in the ready state X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=523586c6bb7338b51940b1d681bddfe214a8fa6f;p=cluster_kv.git for info events, handle them even if you aren't in the ready state --- 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