Skip to content

Commit

Permalink
pacer: add ZeroDelayCalculator
Browse files Browse the repository at this point in the history
  • Loading branch information
Impelon authored and ncw committed Jul 8, 2022
1 parent 53400d7 commit 502226b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/pacer/pacers.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ func (c *Default) Calculate(state State) time.Duration {
return sleepTime
}

// ZeroDelayCalculator is a Calculator that never delays.
type ZeroDelayCalculator struct {
}

// Calculate takes the current Pacer state and return the wait time until the next try.
func (c *ZeroDelayCalculator) Calculate(state State) time.Duration {
return 0
}

// AmazonCloudDrive is a specialized pacer for Amazon Drive
//
// It implements a truncated exponential backoff strategy with randomization.
Expand Down

0 comments on commit 502226b

Please sign in to comment.