Browse Source

godeps: update probing pkg

Xiang Li 10 years ago
parent
commit
709718ed97
2 changed files with 12 additions and 1 deletions
  1. 1 1
      Godeps/Godeps.json
  2. 11 0
      Godeps/_workspace/src/github.com/xiang90/probing/prober.go

+ 1 - 1
Godeps/Godeps.json

@@ -104,7 +104,7 @@
 		},
 		{
 			"ImportPath": "github.com/xiang90/probing",
-			"Rev": "e8a0407769cb84c61c2ddf8f1d9cdae9fb489b9b"
+			"Rev": "11caf1c32ca4055f97e55541e92a75966635981d"
 		},
 		{
 			"ImportPath": "golang.org/x/crypto/bcrypt",

+ 11 - 0
Godeps/_workspace/src/github.com/xiang90/probing/prober.go

@@ -16,6 +16,7 @@ var (
 type Prober interface {
 	AddHTTP(id string, probingInterval time.Duration, endpoints []string) error
 	Remove(id string) error
+	RemoveAll()
 	Reset(id string) error
 	Status(id string) (Status, error)
 }
@@ -88,6 +89,16 @@ func (p *prober) Remove(id string) error {
 	return nil
 }
 
+func (p *prober) RemoveAll() {
+	p.mu.Lock()
+	defer p.mu.Unlock()
+
+	for _, s := range p.targets {
+		close(s.stopC)
+	}
+	p.targets = make(map[string]*status)
+}
+
 func (p *prober) Reset(id string) error {
 	p.mu.Lock()
 	defer p.mu.Unlock()