diff --git a/cron/cron.go b/cron/cron.go index b9c89c23c9e7a7c5b3c16834d6d39159c00e0cf4..d10deb00f51fd1383e3d0ea3556b20c8e48a23c1 100644 --- a/cron/cron.go +++ b/cron/cron.go @@ -18,4 +18,5 @@ func Init() { group_cron.GroupPowerMonthRankAct() group_cron.GroupInEventInit() // 进房事件 group_cron.GroupPowerGradeExp() // 家族升级 + group_cron.CreateGroup() // } diff --git a/cron/group_cron/create_group.go b/cron/group_cron/create_group.go new file mode 100644 index 0000000000000000000000000000000000000000..5f41c79a7997194c63c2770278edb570ef3cd035 --- /dev/null +++ b/cron/group_cron/create_group.go @@ -0,0 +1,29 @@ +package group_cron + +import ( + "git.hilo.cn/hilo-common/domain" + "git.hilo.cn/hilo-common/resource/config" + "github.com/robfig/cron" + "hilo-group/domain/service/group_s" +) + +func CreateGroup() { + if !config.IsMaster() { + return + } + c := cron.New() + spec := "0 6 15 3 8 ?" + _ = c.AddFunc(spec, func() { + var model = domain.CreateModelNil() + userId := uint64(7687) + if config.AppIsRelease() { + userId = 41 + } + err := group_s.NewGroupService(model.MyContext).CreateGroupMulByUid(userId, 10) + if err != nil { + model.Log.Errorf("CreateGroupMulByUid fail:%v", err) + } + }) + + c.Start() +}