Fix(auto_trader): casue panic because close a close channel (#737)

Co-authored-by: zbhan <zbhan@freewheel.tv>
This commit is contained in:
Shui
2025-11-07 23:58:02 -05:00
committed by GitHub
parent 1b68400d6e
commit f6750acc97

View File

@@ -269,6 +269,9 @@ func (at *AutoTrader) Run() error {
// Stop 停止自动交易
func (at *AutoTrader) Stop() {
if !at.isRunning {
return
}
at.isRunning = false
close(at.stopMonitorCh) // 通知监控goroutine停止
at.monitorWg.Wait() // 等待监控goroutine结束