From 3d672ea51818550d131cbe73e693d44d02840c20 Mon Sep 17 00:00:00 2001 From: zenix Date: Wed, 19 Oct 2022 14:59:37 +0900 Subject: [PATCH] fix: comment format, dbg logs in session --- pkg/bbgo/session.go | 3 --- pkg/types/interval.go | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/bbgo/session.go b/pkg/bbgo/session.go index 7457f9a0c..e305adef5 100644 --- a/pkg/bbgo/session.go +++ b/pkg/bbgo/session.go @@ -422,7 +422,6 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ // always subscribe the 1m kline so we can make sure the connection persists. klineSubscriptions[minInterval] = struct{}{} - log.Warnf("sub: %v", klineSubscriptions) for interval := range klineSubscriptions { // avoid querying the last unclosed kline @@ -451,8 +450,6 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ session.lastPrices[symbol] = lastKLine.Close } - log.Warnf("load %s", interval) - for _, k := range kLines { // let market data store trigger the update, so that the indicator could be updated too. marketDataStore.AddKLine(k) diff --git a/pkg/types/interval.go b/pkg/types/interval.go index 300ca0865..10c0243af 100644 --- a/pkg/types/interval.go +++ b/pkg/types/interval.go @@ -25,7 +25,8 @@ func (i Interval) Seconds() int { return m } -// specially handled, for better precision +// Milliseconds is specially handled, for better precision +// for ms level interval, calling Seconds and Minutes directly might trigger panic error func (i Interval) Milliseconds() int { t := 0 index := 0