mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
switch to math/rand/v2 in most places
this allows removing some ugly instantiations of an rng based on the current time. Intn is now IntN for our concurrency-safe prng wrapper to match the randv2 api. v2 exists since go1.22, which we already require.
This commit is contained in:
@ -252,7 +252,7 @@ var jitterRand = mox.NewPseudoRand()
|
||||
// Jitter so we don't cause load at exactly whole hours, other processes may
|
||||
// already be doing that.
|
||||
var jitteredTimeUntil = func(t time.Time) time.Duration {
|
||||
return time.Until(t.Add(time.Duration(30+jitterRand.Intn(60)) * time.Second))
|
||||
return time.Until(t.Add(time.Duration(30+jitterRand.IntN(60)) * time.Second))
|
||||
}
|
||||
|
||||
// Start launches a goroutine that wakes up at each whole hour (plus jitter) and
|
||||
|
Reference in New Issue
Block a user