group_power_grade.go 597 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 21 22
package group_cron

import (
	"git.hilo.cn/hilo-common/domain"
	"hilo-group/domain/cache/groupPower_c"
	"hilo-group/domain/model/groupPower_m"
)

func GroupPowerGradeExp() {
	go func() {
		for true {
			model := domain.CreateModelNil()
			if data := groupPower_c.BLPopGroupPowerGradeExp(model); data != nil {
				if err := model.Transaction(func(model *domain.Model) error {
					return groupPower_m.IncrGroupPowerExp(model, data.GroupPowerId, data.Exp, data.UserId, data.Remark)
				}); err != nil {
					model.Log.Errorf("IncrGroupPowerExp fail,data:%v-err:%v", data, err)
				}
			}
		}
	}()
}