From 74cfec268d63b8a35c86f742b0b0006cce6e409d Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 3 Aug 2023 15:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=B8=B8=E6=88=8F=E6=88=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron/cron.go | 1 + cron/group_cron/create_group.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 cron/group_cron/create_group.go diff --git a/cron/cron.go b/cron/cron.go index b9c89c2..d10deb0 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 0000000..5f41c79 --- /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() +} -- 2.22.0