feat: statistics: finish dev

This commit is contained in:
fallen-angle
2022-01-23 18:28:01 +08:00
parent 582807ae10
commit d844711191
29 changed files with 1670 additions and 51 deletions

14
initialize/cron.go Normal file
View File

@@ -0,0 +1,14 @@
package initialize
import (
"nCovTrack-Backend/service/statistics"
"github.com/robfig/cron/v3"
)
func initCron() {
c := cron.New()
//c.AddFunc("@every 10s", func() { global.Redis.Set("OK", time.Now().String(), time.Duration(10*time.Hour)) })
c.AddFunc("@every 10m", statistics.CacheNCov)
c.Start()
}