Strip blacklist

This commit is contained in:
Asim
2016-06-19 14:41:33 +01:00
parent 95f1e80af4
commit 30e0fef615
5 changed files with 6 additions and 393 deletions

View File

@@ -7,7 +7,6 @@ import (
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/selector"
"github.com/micro/go-micro/selector/internal/blacklist"
)
/*
@@ -27,9 +26,6 @@ type cacheSelector struct {
// used to close or reload watcher
reload chan bool
exit chan bool
// blacklist
bl *blacklist.BlackList
}
var (
@@ -349,13 +345,6 @@ func (c *cacheSelector) Select(service string, opts ...selector.SelectOption) (s
services = filter(services)
}
/*
services, err = c.bl.Filter(services)
if err != nil {
return nil, err
}
*/
// if there's nothing left, return
if len(services) == 0 {
return nil, selector.ErrNoneAvailable
@@ -365,14 +354,11 @@ func (c *cacheSelector) Select(service string, opts ...selector.SelectOption) (s
}
func (c *cacheSelector) Mark(service string, node *registry.Node, err error) {
c.bl.Mark(service, node, err)
return
}
func (c *cacheSelector) Reset(service string) {
c.Lock()
c.del(service)
c.Unlock()
c.bl.Reset(service)
return
}
// Close stops the watcher and destroys the cache
@@ -386,7 +372,6 @@ func (c *cacheSelector) Close() error {
return nil
default:
close(c.exit)
c.bl.Close()
}
return nil
}
@@ -423,7 +408,6 @@ func NewSelector(opts ...selector.Option) selector.Selector {
ttls: make(map[string]time.Time),
reload: make(chan bool, 1),
exit: make(chan bool),
bl: blacklist.New(),
}
go c.run()