We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2faecc1 commit 94f812bCopy full SHA for 94f812b
selector.go
@@ -240,7 +240,6 @@ func (f *FastestFilter) Filter(nodes []Node) []Node {
240
241
// get latency with ttl cache
242
now := time.Now().Unix()
243
- r := rand.New(rand.NewSource(time.Now().UnixNano()))
244
245
var getNodeLatency = func(node Node) int {
246
if f.pingResultTTL[node.ID] < now {
@@ -251,7 +250,8 @@ func (f *FastestFilter) Filter(nodes []Node) []Node {
251
250
// get latency
252
go func(node Node) {
253
latency := f.doTcpPing(node.Addr)
254
- ttl := 300 - int64(60*r.Float64())
+ r := rand.New(rand.NewSource(time.Now().UnixNano()))
+ ttl := 300 - int64(120*r.Float64())
255
256
f.mu.Lock()
257
f.pingResult[node.ID] = latency
0 commit comments