From 9bdc05b69c9e75a6e4256ffd09a50df05f0867e0 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 19 Jan 2022 18:26:57 +0800 Subject: [PATCH] strategy/grid: use background context for canceling orders --- pkg/strategy/grid/strategy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/strategy/grid/strategy.go b/pkg/strategy/grid/strategy.go index e6e4bf87c..b59504368 100644 --- a/pkg/strategy/grid/strategy.go +++ b/pkg/strategy/grid/strategy.go @@ -616,7 +616,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se // now we can cancel the open 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") } })