aa
This commit is contained in:
@@ -226,6 +226,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
|||||||
if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute+time.Second*2 {
|
if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute+time.Second*2 {
|
||||||
changePrinterStatus(key, printerStatusOffline)
|
changePrinterStatus(key, printerStatusOffline)
|
||||||
if t.isExist(key) {
|
if t.isExist(key) {
|
||||||
|
globals.SugarLogger.Debugf("HandleCheckTcpHeart del key,%v", key)
|
||||||
t.clear(key)
|
t.clear(key)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ func (t *TcpClient) isExist(key string) bool {
|
|||||||
func (t *TcpClient) setPrintStatus(key string, status int) {
|
func (t *TcpClient) setPrintStatus(key string, status int) {
|
||||||
t.Lock()
|
t.Lock()
|
||||||
defer t.Unlock()
|
defer t.Unlock()
|
||||||
if t.isExist(key) {
|
if t.Clients[key] != nil {
|
||||||
t.Clients[key].Status = status
|
t.Clients[key].Status = status
|
||||||
t.Clients[key].StatusTime = time.Now()
|
t.Clients[key].StatusTime = time.Now()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user