From f3aaacae0a3c90e7a327bd3ba2a5799c54da021f Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 3 Aug 2021 11:28:16 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 6 ++---- business/jxstore/event/event_tcp_utils.go | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 45be0933a..c6e83ac9a 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -234,7 +234,6 @@ func (t *TcpClient) doPrint(key string) (err error) { dao.UpdateEntity(db, printMsg, "Status", "Comment") if t.isExist(key) { t.clear(key) - close(t.TimeoutMap[key]) } return } else { @@ -244,8 +243,8 @@ func (t *TcpClient) doPrint(key string) (err error) { //t.delConn(printMsg.PrintNo) if t.isExist(key) { t.clear(key) - close(t.TimeoutMap[key]) } + return } else { globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data)) //等待回调 @@ -278,9 +277,8 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) { changePrinterStatus(key, printerStatusOffline) if t.isExist(key) { t.clear(key) - close(t.TimeoutMap[key]) - return } + return } } } diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index cd82da2fd..528ec3c77 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -280,6 +280,8 @@ func (t *TcpClient) clear(key string) { delete(t.MsgMap, key) close(t.CallBackMap[key]) delete(t.CallBackMap, key) + close(t.TimeoutMap[key]) + delete(t.TimeoutMap, key) } func NewTcpClient() *TcpClient {