From fe763eba27addfe615d2c107b8984484baef9a23 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期一, 29 四月 2024 03:27:09 +0800 Subject: [PATCH] 完善下级功能 --- service/resend.go | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/service/resend.go b/service/resend.go index 7cac1a9..e56ffc1 100644 --- a/service/resend.go +++ b/service/resend.go @@ -1,10 +1,12 @@ package service import ( + "gat1400Exchange/client" "gat1400Exchange/config" "gat1400Exchange/models" "gat1400Exchange/pkg/logger" "gat1400Exchange/util" + "gat1400Exchange/vo" ) func ResendImageData() { @@ -18,13 +20,22 @@ } for _, c := range cacheItems { - if !util.SendData([]byte(c.Data), config.ForwardConf.SyncServer) { - c.UpdateRetryCount() - logger.Warn("The data resend failed. retry count %d", c.Retry+1) + if c.Type == "1400" { + if client.FaceCapture([]byte(c.Data)) != vo.StatusSuccess { + c.UpdateRetryCount() + logger.Warn("The data resend failed. retry count %d", c.Retry+1) + continue + } } else { - c.Delete() - logger.Debug("The data resend successful.") + if !util.SendData([]byte(c.Data), config.ForwardConf.SyncServer) { + c.UpdateRetryCount() + logger.Warn("The data resend failed. retry count %d", c.Retry+1) + continue + } } + + c.Delete() + logger.Debug("The data resend successful.") } } -- Gitblit v1.8.0