fix: rand seed for network check (#106)

This commit is contained in:
mzz 2023-05-30 23:01:23 +08:00 committed by GitHub
parent 46ee3201c4
commit 689fa0f01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ package cmd
import (
"errors"
"fmt"
"math/rand"
"github.com/mzz2017/softwind/pkg/fastrand"
"net"
"net/http"
"os"
@ -45,7 +45,7 @@ func init() {
runCmd.PersistentFlags().BoolVarP(&disableTimestamp, "disable-timestamp", "", false, "disable timestamp")
runCmd.PersistentFlags().BoolVarP(&disableTimestamp, "disable-pidfile", "", false, "not generate /var/run/dae.pid")
rand.Shuffle(len(CheckNetworkLinks), func(i, j int) {
fastrand.Rand().Shuffle(len(CheckNetworkLinks), func(i, j int) {
CheckNetworkLinks[i], CheckNetworkLinks[j] = CheckNetworkLinks[j], CheckNetworkLinks[i]
})
}