This commit is contained in:
suyl
2021-08-02 15:06:15 +08:00
parent 48a1b0d210
commit fbc3c7ec8c

View File

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