| | |
| | | ) |
| | | |
| | | func ResendImageData() { |
| | | if err := util.HttpGet(config.ForwardConf.SyncServer); err != nil { |
| | | logger.Debug("The server cannot be reached. %s", err.Error()) |
| | | return |
| | | } |
| | | |
| | | var cacheMod models.Cache |
| | | cacheItems, _ := cacheMod.FindAll() |
| | | logger.Debug("Start resend task. cache len:%d", len(cacheItems)) |
| | |
| | | if client.FaceCapture([]byte(c.Data)) != vo.StatusSuccess { |
| | | c.UpdateRetryCount() |
| | | logger.Warn("The data resend failed. retry count %d", c.Retry+1) |
| | | continue |
| | | return |
| | | } |
| | | } else { |
| | | if !util.SendData([]byte(c.Data), config.ForwardConf.SyncServer) { |
| | | c.UpdateRetryCount() |
| | | logger.Warn("The data resend failed. retry count %d", c.Retry+1) |
| | | continue |
| | | return |
| | | } |
| | | } |
| | | |