bbgo: register onShutdown from the trader

This commit is contained in:
c9s 2022-09-30 16:47:04 +08:00
parent 76b0f5518d
commit 77ca1a9c75
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -221,8 +221,7 @@ func (trader *Trader) RunSingleExchangeStrategy(ctx context.Context, strategy Si
} }
if shutdown, ok := strategy.(StrategyShutdown); ok { if shutdown, ok := strategy.(StrategyShutdown); ok {
// Register the shutdown callback trader.gracefulShutdown.OnShutdown(shutdown.Shutdown)
OnShutdown(shutdown.Shutdown)
} }
return strategy.Run(ctx, orderExecutor, session) return strategy.Run(ctx, orderExecutor, session)