| | |
| | | package service |
| | | |
| | | import ( |
| | | "gat1400Exchange/client" |
| | | "gat1400Exchange/config" |
| | | "gat1400Exchange/models" |
| | | "gat1400Exchange/pkg/logger" |
| | | "gat1400Exchange/util" |
| | | "gat1400Exchange/vo" |
| | | ) |
| | | |
| | | func ResendImageData() { |
| | |
| | | } |
| | | |
| | | 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.") |
| | | } |
| | | |
| | | } |