diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index f63f061d5..210d720af 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -94,8 +94,8 @@ func (t *TcpClient) handleConn(c net.Conn) { //t.Clients[printNo] = printInfo //t.Unlock() t.addConn(c, printNo, status) - t.buildCallBackMap(printNo) - t.buildMsgMap(printNo) + //t.buildCallBackMap(printNo) + //t.buildMsgMap(printNo) go t.doPrint2(printNo) changePrinterStatus(printNo, status) if status == printerStatusOnline { diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 9be96a050..344fb3465 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -219,8 +219,8 @@ func (t *TcpClient) setPrintStatus(key string, status int) { } func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) { - t.RLock() - defer t.RUnlock() + t.Lock() + defer t.Unlock() if !t.isExistMsg(printMsg.PrintNo) { t.buildMsgMap(printMsg.PrintNo) } @@ -228,8 +228,8 @@ func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) { } func (t *TcpClient) addCallbackChan(key, data string) { - t.RLock() - defer t.RUnlock() + t.Lock() + defer t.Unlock() if !t.isExistCallback(key) { t.buildCallBackMap(key) }