diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index d66c790e8..d051cabd8 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -222,11 +222,13 @@ func (t *TcpClient) doPrint(key string) (err error) { func (t *TcpClient) HandleCheckTcpHeart(key string) { go func() { for { - if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute+time.Second*2 { - changePrinterStatus(key, printerStatusOffline) - if t.isExist(key) { - t.clear(key) - return + if !utils.IsTimeZero(t.getPrintStatusTime(key)) { + if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute+time.Second*2 { + changePrinterStatus(key, printerStatusOffline) + if t.isExist(key) { + t.clear(key) + return + } } } //keys := []string{}