group_list.go 921 Bytes
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
package group_cron

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

// 清理家族经验和等级
func GroupCountryListSort() {

	// 常用国家-每15分钟计算国家房间列表排序 /v1/imGroup/country [get] 接口
	spec := "0 */15 * * * ?"
	c := cron.New()
	_ = c.AddFunc(spec, func() {
		var model = domain.CreateModelNil()
		model.Log.Infof("GroupCountryListSort Common start")
		group_s.SortGroupCommonCountryList(model)
		model.Log.Infof("GroupCountryListSort Common end")
	})

	// 非常用国家-每60分钟计算国家房间列表排序 /v1/imGroup/country [get] 接口
chenweijian's avatar
chenweijian committed
23
	spec2 := "0 59 * * * ?"
chenweijian's avatar
chenweijian committed
24 25 26 27 28 29 30 31 32
	_ = c.AddFunc(spec2, func() {
		var model = domain.CreateModelNil()
		model.Log.Infof("GroupCountryListSort not Common start")
		group_s.SortGroupNotCommonCountryList(model)
		model.Log.Infof("GroupCountryListSort not Common end")
	})

	c.Start()
}