unblack list when err is nil
This commit is contained in:
parent
f59787a906
commit
46905347bb
@ -107,6 +107,11 @@ func (r *blackListSelector) Select(service string, opts ...SelectOption) (Select
|
|||||||
func (r *blackListSelector) Mark(service string, node *Node, err error) {
|
func (r *blackListSelector) Mark(service string, node *Node, err error) {
|
||||||
r.Lock()
|
r.Lock()
|
||||||
defer r.Unlock()
|
defer r.Unlock()
|
||||||
|
if err == nil {
|
||||||
|
delete(r.bl, node.Id)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
r.bl[node.Id] = blackListNode{
|
r.bl[node.Id] = blackListNode{
|
||||||
age: time.Now().Add(time.Duration(r.ttl) * time.Second),
|
age: time.Now().Add(time.Duration(r.ttl) * time.Second),
|
||||||
id: node.Id,
|
id: node.Id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user