package rank

import (
	"mongo.games.com/goserver/core/logger"

	"mongo.games.com/game/model"
	"mongo.games.com/game/ranksrv/com"
)

var InviteLogMgrInstance = com.NewListMgr[*model.InviteInfo](
	func() int64 {
		return 5 // 缓存5秒
	},
	func(platform string, index int32) ([]*model.InviteInfo, error) {
		logger.Logger.Tracef("load invitelog platform:%s snid:%d", platform, index)
		ret, err := model.GetInviteList(platform, index)
		if err != nil {
			logger.Logger.Errorf("load invitelog err:%s", err.Error())
			return nil, err
		}
		return ret, nil
	})
