mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-15 16:56:56 +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 停止自动交易
|
// Stop 停止自动交易
|
||||||
func (at *AutoTrader) Stop() {
|
func (at *AutoTrader) Stop() {
|
||||||
|
if !at.isRunning {
|
||||||
|
return
|
||||||
|
}
|
||||||
at.isRunning = false
|
at.isRunning = false
|
||||||
close(at.stopMonitorCh) // 通知监控goroutine停止
|
close(at.stopMonitorCh) // 通知监控goroutine停止
|
||||||
at.monitorWg.Wait() // 等待监控goroutine结束
|
at.monitorWg.Wait() // 等待监控goroutine结束
|
||||||
|
|||||||
Reference in New Issue
Block a user