zhangzengfei
2024-04-16 808ce8f0bfa59f6333c27391b6983bdd67fd0bd6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package service
 
import (
    "gat1400Exchange/config"
    "gat1400Exchange/models"
    "gat1400Exchange/pkg/logger"
    "gat1400Exchange/util"
)
 
func ResendImageData() {
    var cacheMod models.Cache
    cacheItems, _ := cacheMod.FindAll()
 
    for _, c := range cacheItems {
        if !util.SendData([]byte(c.Data), config.ForwardConf.SyncServer) {
            logger.Warn("The data resend failed. retry count %d", c.Retry)
 
            c.Retry = c.Retry + 1
            c.Update()
        } else {
            c.Delete()
            logger.Debug("The data resend successful.")
        }
    }
 
}