strategy/grid: use background context for canceling orders

This commit is contained in:
c9s 2022-01-19 18:26:57 +08:00
parent 9953a30717
commit 9bdc05b69c

View File

@ -616,7 +616,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
// now we can cancel the open orders // now we can cancel the open orders
log.Infof("canceling active orders...") log.Infof("canceling active orders...")
if err := session.Exchange.CancelOrders(ctx, s.activeOrders.Orders()...); err != nil { if err := session.Exchange.CancelOrders(context.Background(), s.activeOrders.Orders()...); err != nil {
log.WithError(err).Errorf("cancel order error") log.WithError(err).Errorf("cancel order error")
} }
}) })