Skip to content

Commit

Permalink
改回go1.21版本
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Sep 10, 2024
1 parent 88a2592 commit f6cb50b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions defaultServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package fSchedule
import (
"fmt"
"github.com/farseer-go/fs/flog"
"math/rand/v2"
"math/rand"
"time"
)

const tokenName = "FSchedule-ACCESS-TOKEN"
Expand All @@ -26,7 +27,8 @@ func (receiver *serverVO) getAddress() string {
if count == 1 {
address = receiver.Address[0]
} else {
address = receiver.Address[rand.IntN(count-1)]
//address = receiver.Address[rand.IntN(count-1)]
address = receiver.Address[rand.New(rand.NewSource(time.Now().UnixNano())).Intn(count-1)]
}

return fmt.Sprintf("%s/ws/connect", address)
Expand Down

0 comments on commit f6cb50b

Please sign in to comment.