mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-09 21:49:39 -05:00
derp: fix flaky shuffle test (#2772)
This commit is contained in:
@@ -140,10 +140,13 @@ var crc64Table = crc64.MakeTable(crc64.ISO)
|
||||
var (
|
||||
derpRandomOnce sync.Once
|
||||
derpRandomInst *rand.Rand
|
||||
derpRandomMu sync.RWMutex
|
||||
derpRandomMu sync.Mutex
|
||||
)
|
||||
|
||||
func derpRandom() *rand.Rand {
|
||||
derpRandomMu.Lock()
|
||||
defer derpRandomMu.Unlock()
|
||||
|
||||
derpRandomOnce.Do(func() {
|
||||
seed := cmp.Or(viper.GetString("dns.base_domain"), time.Now().String())
|
||||
rnd := rand.New(rand.NewSource(0))
|
||||
|
||||
Reference in New Issue
Block a user