From b4a86051e9bf4888fd5d01c12232a26f3874e03b Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 17 十月 2024 21:30:18 +0800
Subject: [PATCH] 完善epc读取楼层

---
 service/resend.go |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/service/resend.go b/service/resend.go
index ade60a8..6961f45 100644
--- a/service/resend.go
+++ b/service/resend.go
@@ -20,7 +20,11 @@
 
 	var cacheMod models.Cache
 	total, _ := cacheMod.Count()
-	logger.Debug("Start resend task. cache len:%d", total)
+	if total == 0 {
+		return
+	}
+
+	logger.Info("Start resend task. cache len:%d", total)
 
 	for i := 0; i < int(total); i++ {
 		var c models.Cache
@@ -29,12 +33,18 @@
 			logger.Error(err.Error())
 			return
 		}
-		if c.Type == "1400" {
+		if c.Type == "1400-face" {
 			if client.FaceCapture([]byte(c.Data)) != vo.StatusSuccess {
 				c.UpdateRetryCount()
 				logger.Warn("The data resend failed. retry count %d", c.Retry+1)
 				return
 			}
+		} else if c.Type == "1400-person" {
+			if client.PersonCapture([]byte(c.Data)) != vo.StatusSuccess {
+				c.UpdateRetryCount()
+				logger.Warn("The data resend failed. retry count %d", c.Retry+1)
+				return
+			}
 		} else {
 			if !util.SendData([]byte(c.Data), config.ForwardConf.SyncServer) {
 				c.UpdateRetryCount()

--
Gitblit v1.8.0