mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 21:34:38 +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:
@ -73,7 +73,7 @@ var jitterRand = mox.NewPseudoRand()
|
||||
// Jitter so we don't cause load at exactly midnight, other processes may
|
||||
// already be doing that.
|
||||
var jitteredTimeUntil = func(t time.Time) time.Duration {
|
||||
return time.Until(t.Add(time.Duration(240+jitterRand.Intn(120)) * time.Second))
|
||||
return time.Until(t.Add(time.Duration(240+jitterRand.IntN(120)) * time.Second))
|
||||
}
|
||||
|
||||
// Start launches a goroutine that wakes up just after 00:00 UTC to send TLSRPT
|
||||
|
Reference in New Issue
Block a user