1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

unblack list when err is nil

This commit is contained in:
Asim 2015-12-09 02:42:02 +00:00
parent f59787a906
commit 46905347bb

View File

@ -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,