package glock

import (
	"github.com/stathat/consistent"
)

func initServersPool(endpoints []string) *consistent.Consistent {
	cons := consistent.New()
	for _, endpoint := range endpoints {
		// TODO: First check if endpoint is live
		cons.Add(endpoint)
	}
	return cons
}

package glock

import (
	"net"

	"github.com/stathat/consistent"
)

func initServersPool(endpoints []string) *consistent.Consistent {
	cons := consistent.New()
	for _, endpoint := range endpoints {
		conn, err := net.Dial("tcp", endpoint)
		if err == nil {
			cons.Add(endpoint)
			conn.Close()
		}
	}
	return cons
}

Check endpoint status first before adding into the hash table
Check endpoint status first before adding into the hash table
