fix cascading backoff

This commit is contained in:
Minhan Xia
2016-02-22 17:01:55 -08:00
parent 6cecf2b357
commit 973b01ee29
2 changed files with 8 additions and 1 deletions

View File

@@ -120,6 +120,12 @@ func (p *Backoff) GC() {
}
}
func (p *Backoff) DeleteEntry(id string) {
p.Lock()
defer p.Unlock()
delete(p.perItemBackoff, id)
}
// Take a lock on *Backoff, before calling initEntryUnsafe
func (p *Backoff) initEntryUnsafe(id string) *backoffEntry {
entry := &backoffEntry{backoff: p.defaultDuration}