move math rand

This commit is contained in:
c9s 2021-12-30 16:18:32 +08:00
parent e73866a232
commit a2931da92c
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt"
"image/png"
"io/ioutil"
"math/rand"
"os"
"strings"
"sync"
@ -27,6 +28,11 @@ import (
"github.com/c9s/bbgo/pkg/util"
)
func init() {
// randomize pulling
rand.Seed(time.Now().UnixNano())
}
var LoadedExchangeStrategies = make(map[string]SingleExchangeStrategy)
var LoadedCrossExchangeStrategies = make(map[string]CrossExchangeStrategy)

View File

@ -55,8 +55,6 @@ const writeTimeout = 10 * time.Second
const listenKeyKeepAliveInterval = 10 * time.Minute
func init() {
// randomize pulling
rand.Seed(time.Now().UnixNano())
debugBinanceDepth, _ = strconv.ParseBool(os.Getenv("DEBUG_BINANCE_DEPTH"))
if debugBinanceDepth {