This commit is contained in:
suyl
2021-07-30 17:37:39 +08:00
parent 6668ce23c7
commit 9f4786de45
2 changed files with 6 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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)
}