bollmaker: skip submitOrder calls if submitOrders is empty

This commit is contained in:
c9s 2022-01-09 02:35:12 +08:00
parent 656ef942e4
commit 0cec652f38
2 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,7 @@ func (b *LocalActiveOrderBook) GracefulCancel(ctx context.Context, ex types.Exch
} }
} }
log.Info("all orders are cancelled successfully") log.Debug("all orders are cancelled successfully")
return nil return nil
} }

View File

@ -305,6 +305,10 @@ func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExec
} }
if len(submitOrders) == 0 {
return
}
createdOrders, err := orderExecutor.SubmitOrders(ctx, submitOrders...) createdOrders, err := orderExecutor.SubmitOrders(ctx, submitOrders...)
if err != nil { if err != nil {
log.WithError(err).Errorf("can not place ping pong orders") log.WithError(err).Errorf("can not place ping pong orders")