From 4c655282e5c965294b30edbf0cf4d65af0396f2e Mon Sep 17 00:00:00 2001 From: satoren Date: Wed, 2 Mar 2022 10:41:54 +0900 Subject: [PATCH] auto reconnect when disconnected by some reason --- lib/strategy/tags.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/strategy/tags.ex b/lib/strategy/tags.ex index 8206fd4..2ddef1d 100644 --- a/lib/strategy/tags.ex +++ b/lib/strategy/tags.ex @@ -85,7 +85,6 @@ defmodule ClusterEC2.Strategy.Tags do defp load(%State{topology: topology, connect: connect, disconnect: disconnect, list_nodes: list_nodes} = state) do case get_nodes(state) do {:ok, new_nodelist} -> - added = MapSet.difference(new_nodelist, state.meta) removed = MapSet.difference(state.meta, new_nodelist) new_nodelist = @@ -101,7 +100,7 @@ defmodule ClusterEC2.Strategy.Tags do end new_nodelist = - case Cluster.Strategy.connect_nodes(topology, connect, list_nodes, MapSet.to_list(added)) do + case Cluster.Strategy.connect_nodes(topology, connect, list_nodes, MapSet.to_list(new_nodelist)) do :ok -> new_nodelist