Skip to content

Commit

Permalink
Fix SleepWithJitter doubles duration than expected (#5481)
Browse files Browse the repository at this point in the history
Signed-off-by: Changxin Miao <[email protected]>
  • Loading branch information
polyrabbit authored Dec 30, 2024
1 parent 2dbd135 commit f099f14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/utils/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

func SleepWithJitter(d time.Duration) {
time.Sleep(d + JitterIt(d))
time.Sleep(JitterIt(d))
}

func JitterIt[T float64 | time.Duration](d T) T {
Expand Down

0 comments on commit f099f14

Please sign in to comment.