From fbc3c7ec8c5199274d7f3f3488f1bffe10ac3319 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Mon, 2 Aug 2021 15:06:15 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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{}