Backoff and Randomness additions for use in client utilities
Updated String to use int, and int not to panic, and panic to test panic Format fixes.
This commit is contained in:
@@ -70,6 +70,13 @@ func (p *Backoff) Next(id string, eventTime time.Time) {
|
||||
entry.lastUpdate = p.Clock.Now()
|
||||
}
|
||||
|
||||
// Reset forces clearing of all backoff data for a given key.
|
||||
func (p *Backoff) Reset(id string) {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
delete(p.perItemBackoff, id)
|
||||
}
|
||||
|
||||
// Returns True if the elapsed time since eventTime is smaller than the current backoff window
|
||||
func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool {
|
||||
p.Lock()
|
||||
|
Reference in New Issue
Block a user