mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
binance: add DEBUG_BINANCE_STREAM env var
This commit is contained in:
parent
a2931da92c
commit
d72d57526c
|
@ -2,7 +2,6 @@ package binance
|
|||
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -11,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/depth"
|
||||
"github.com/c9s/bbgo/pkg/util"
|
||||
|
@ -55,11 +55,15 @@ const writeTimeout = 10 * time.Second
|
|||
const listenKeyKeepAliveInterval = 10 * time.Minute
|
||||
|
||||
func init() {
|
||||
|
||||
debugBinanceDepth, _ = strconv.ParseBool(os.Getenv("DEBUG_BINANCE_DEPTH"))
|
||||
if debugBinanceDepth {
|
||||
log.Info("binance depth debugging is enabled")
|
||||
}
|
||||
|
||||
debugBinanceStream, _ := strconv.ParseBool(os.Getenv("DEBUG_BINANCE_STREAM"))
|
||||
if debugBinanceStream {
|
||||
log.Level = logrus.DebugLevel
|
||||
}
|
||||
}
|
||||
|
||||
type StreamRequest struct {
|
||||
|
@ -416,7 +420,7 @@ func (s *Stream) connect(ctx context.Context) error {
|
|||
}
|
||||
|
||||
go s.read(s.connCtx, conn)
|
||||
go s.ping(s.connCtx, conn, readTimeout / 3)
|
||||
go s.ping(s.connCtx, conn, readTimeout/3)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user