twap: call trade collector process when shutdown

This commit is contained in:
c9s 2024-08-20 14:30:08 +08:00
parent b9c41b7ad7
commit 6d3a18ad55
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -603,6 +603,8 @@ func (e *FixedQuantityExecutor) Done() <-chan struct{} {
// 1. Stop the order updater (by using the execution context)
// 2. The order updater cancels all open orders and closes the user data stream
func (e *FixedQuantityExecutor) Shutdown(shutdownCtx context.Context) {
e.tradeCollector.Process()
e.mu.Lock()
if e.cancelExecution != nil {
e.cancelExecution()