svip_vip_noble.go 416 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package user_cron

import (
	"git.hilo.cn/hilo-common/domain"
	"github.com/robfig/cron"
	"hilo-group/domain/cache/user_c"
)

// 加载数据到lru
func LoadSvipVipNoble() {
	go user_c.LoadAllSvipVipNoble(domain.CreateModelNil()) // 启动先执行一次

	c := cron.New()
	spec := "0 */30 * * * ?"
	_ = c.AddFunc(spec, func() {
		model := domain.CreateModelNil()
		user_c.LoadAllSvipVipNoble(model)
	})
	c.Start()
}