[bug]12号线联锁通信服务TCP连接失败后再次启动会提示任务已启动

This commit is contained in:
thesai 2024-06-14 11:37:15 +08:00
parent 807bce391c
commit 1a114a9c44

View File

@ -69,12 +69,11 @@ func (i *interlockProxy) Start(manager InterlockMessageManager) {
if i.manager != nil {
panic(fmt.Sprintf("%s启动联锁消息服务错误: 存在正在运行的任务", logTag))
}
i.manager = manager
// 初始化客户端、服务端
i.initInterlockProxy()
ctx, cancel := context.WithCancel(context.Background())
go i.collectInfoStateTask(ctx)
i.collectInfoTaskCancel = cancel
i.manager = manager
}
// 采集电路状态发送间隔,单位ms