mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
bbgo: pass the actual context object instead of background context
This commit is contained in:
parent
329b8a40d9
commit
768428a7eb
|
@ -146,12 +146,11 @@ func (b *ActiveOrderBook) FastCancel(ctx context.Context, ex types.Exchange, ord
|
|||
|
||||
// optimize order cancel for back-testing
|
||||
if IsBackTesting {
|
||||
return ex.CancelOrders(context.Background(), orders...)
|
||||
return ex.CancelOrders(ctx, orders...)
|
||||
}
|
||||
|
||||
log.Debugf("[ActiveOrderBook] no wait cancelling %s orders...", b.Symbol)
|
||||
// since ctx might be canceled, we should use background context here
|
||||
if err := ex.CancelOrders(context.Background(), orders...); err != nil {
|
||||
if err := ex.CancelOrders(ctx, orders...); err != nil {
|
||||
log.WithError(err).Errorf("[ActiveOrderBook] no wait can not cancel %s orders", b.Symbol)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user