From 77ca1a9c75977cfd77476d197699593140baee11 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 30 Sep 2022 16:47:04 +0800 Subject: [PATCH] bbgo: register onShutdown from the trader --- pkg/bbgo/trader.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/bbgo/trader.go b/pkg/bbgo/trader.go index 74be67435..3708ed10f 100644 --- a/pkg/bbgo/trader.go +++ b/pkg/bbgo/trader.go @@ -221,8 +221,7 @@ func (trader *Trader) RunSingleExchangeStrategy(ctx context.Context, strategy Si } if shutdown, ok := strategy.(StrategyShutdown); ok { - // Register the shutdown callback - OnShutdown(shutdown.Shutdown) + trader.gracefulShutdown.OnShutdown(shutdown.Shutdown) } return strategy.Run(ctx, orderExecutor, session)