Ignore self if in list of peers

This commit is contained in:
Ingo Oppermann 2023-11-15 10:11:07 +01:00
parent 0863d8b6ff
commit 8d63cafda0
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -321,6 +321,10 @@ func New(config Config) (Cluster, error) {
peers := []raft.Peer{}
for _, p := range config.Peers {
if p.ID == config.ID && p.Address == config.Address {
continue
}
peers = append(peers, raft.Peer{
ID: p.ID,
Address: p.Address,