Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for func (0.01 sec)

  1. internal/dsync/utils.go

    package dsync
    
    import (
    	"math/rand"
    	"time"
    )
    
    func backoffWait(min, unit, cap time.Duration) func(*rand.Rand, uint) time.Duration {
    	if unit > time.Hour {
    		// Protect against integer overflow
    		panic("unit cannot exceed one hour")
    	}
    	return func(r *rand.Rand, attempt uint) time.Duration {
    		sleep := min
    		sleep += unit * time.Duration(attempt)
    		if sleep > cap {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat May 13 15:42:21 UTC 2023
    - 1.2K bytes
    - Viewed (0)
Back to top