zhangzengfei
2024-10-17 b4a86051e9bf4888fd5d01c12232a26f3874e03b
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()