mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-04 11:30:58 +08:00
Fix(auto_trader): casue panic because close a close channel (#737)
Co-authored-by: zbhan <zbhan@freewheel.tv>
This commit is contained in:
@@ -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结束
|
||||
|
||||
Reference in New Issue
Block a user