diff --git a/lib/pacer/pacers.go b/lib/pacer/pacers.go index d510eea6436c2..94ef86ccbcf79 100644 --- a/lib/pacer/pacers.go +++ b/lib/pacer/pacers.go @@ -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.