query markets and assign into the exchange session

This commit is contained in:
c9s 2020-10-15 21:04:02 +08:00
parent c167b2f303
commit 113cc8ee48

View File

@ -103,6 +103,13 @@ func (environ *Environment) Init(ctx context.Context) (err error) {
loadedSymbols[sub.Symbol] = struct{}{} loadedSymbols[sub.Symbol] = struct{}{}
} }
markets, err := session.Exchange.QueryMarkets(ctx)
if err != nil {
return err
}
session.Markets = markets
for symbol := range loadedSymbols { for symbol := range loadedSymbols {
if err := environ.TradeSync.Sync(ctx, session.Exchange, symbol, startTime); err != nil { if err := environ.TradeSync.Sync(ctx, session.Exchange, symbol, startTime); err != nil {
return err return err