add sync stra log

This commit is contained in:
710leo 2021-02-03 16:55:14 +08:00
parent db97453c54
commit 900896c045
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,6 @@ func SyncStras() {
t1 := time.NewTicker(time.Duration(CHECK_INTERVAL) * time.Second)
syncStras()
logger.Info("[cron] sync stras start...")
for {
<-t1.C
syncStras()
@ -21,6 +20,8 @@ func SyncStras() {
}
func syncStras() {
logger.Info("[cron] sync stras start...")
start := time.Now().Unix()
stras, err := models.EffectiveStrasList()
if err != nil {
logger.Error("sync stras err:", err)
@ -91,6 +92,7 @@ func syncStras() {
}
}
StraCache.SetAll(strasMap)
logger.Infof("[cron] sync stras done, cost: %dms", time.Now().Sub(start).Milliseconds())
}
func CleanStraLoop() {