From 46905347bb89bd6d2dea76383b1a7a60f643e01e Mon Sep 17 00:00:00 2001 From: Asim Date: Wed, 9 Dec 2015 02:42:02 +0000 Subject: [PATCH] unblack list when err is nil --- registry/black_list_selector.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/registry/black_list_selector.go b/registry/black_list_selector.go index 54412b51..902b9924 100644 --- a/registry/black_list_selector.go +++ b/registry/black_list_selector.go @@ -107,6 +107,11 @@ func (r *blackListSelector) Select(service string, opts ...SelectOption) (Select func (r *blackListSelector) Mark(service string, node *Node, err error) { r.Lock() defer r.Unlock() + if err == nil { + delete(r.bl, node.Id) + return + } + r.bl[node.Id] = blackListNode{ age: time.Now().Add(time.Duration(r.ttl) * time.Second), id: node.Id,