mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
service: handle error
This commit is contained in:
parent
9a1d2cba31
commit
f661db56bd
|
@ -25,8 +25,13 @@ type SyncService struct {
|
|||
func (s *SyncService) SyncSessionSymbols(ctx context.Context, exchange types.Exchange, startTime time.Time, symbols ...string) error {
|
||||
for _, symbol := range symbols {
|
||||
log.Infof("syncing %s %s trades...", exchange.Name(), symbol)
|
||||
// TODO: bbgo import cycle error
|
||||
//markets, err := bbgo.LoadExchangeMarketsWithCache(ctx, exchange)
|
||||
markets, err := exchange.QueryMarkets(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := markets[symbol]; ok {
|
||||
if err := s.TradeService.Sync(ctx, exchange, symbol, startTime); err != nil {
|
||||
return err
|
||||
|
@ -37,7 +42,6 @@ func (s *SyncService) SyncSessionSymbols(ctx context.Context, exchange types.Exc
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.Infof("syncing %s deposit records...", exchange.Name())
|
||||
if err := s.DepositService.Sync(ctx, exchange); err != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user