group_list.go 921 Bytes
Newer Older
chenweijian's avatar
chenweijian committed
1 2 3 4 5 6 7 8 9 10 11 12
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] 接口
chenweijian's avatar
chenweijian committed
13
	spec := "0 */15 * * * ?"
chenweijian's avatar
chenweijian committed
14 15 16
	c := cron.New()
	_ = c.AddFunc(spec, func() {
		var model = domain.CreateModelNil()
chenweijian's avatar
chenweijian committed
17
		model.Log.Infof("GroupCountryListSort Common start")
chenweijian's avatar
chenweijian committed
18
		group_s.SortGroupCommonCountryList(model)
chenweijian's avatar
chenweijian committed
19
		model.Log.Infof("GroupCountryListSort Common end")
chenweijian's avatar
chenweijian committed
20 21 22
	})

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

	c.Start()
}