Browse Source

用户设备数量,在线设备,离线设备数量

baozhensong 6 years ago
parent
commit
a32dc113ac
1 changed files with 1 additions and 1 deletions
  1. 1 1
      services/knowoapi/services/device.go

+ 1 - 1
services/knowoapi/services/device.go

@@ -109,7 +109,7 @@ func (a deviceservice) GetDevicesCountByVenderId(vendorid uint) (map[string]inte
 			return nil, err
 		}
 
-		if int(onlinereply.HeartbeatInterval) > 0 && len(onlinereply.ClientIP) > 0 {
+		if int(onlinereply.HeartbeatInterval) > 0 && len(onlinereply.ClientIP) > 0 && err.Error() != "redigo: nil returned" {
 			onlineCount += 1
 		} else {
 			offlineCount += 1