From 69e00cfa452eddf2e3c9b4eb3325c9b70e4dea23 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 13 Jul 2023 10:12:18 +0800 Subject: [PATCH] =?UTF-8?q?cp=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- corn/cp_corn/cp.go => cron/cp_cron/cp_relation.go | 8 +++++--- cron/cron.go | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) rename corn/cp_corn/cp.go => cron/cp_cron/cp_relation.go (94%) diff --git a/corn/cp_corn/cp.go b/cron/cp_cron/cp_relation.go similarity index 94% rename from corn/cp_corn/cp.go rename to cron/cp_cron/cp_relation.go index aed68b3..678cc41 100644 --- a/corn/cp_corn/cp.go +++ b/cron/cp_cron/cp_relation.go @@ -1,4 +1,4 @@ -package cp_corn +package cp_cron import ( "git.hilo.cn/hilo-common/_const/enum/diamond_e" @@ -36,6 +36,7 @@ func CpInviteCancelInit() { return } for _, v := range inviteList { + model := domain.CreateModelContext(model.MyContext) model.Log.Infof("CpInviteCancelInit invite:%+v", v) err = model.Transaction(func(model *domain.Model) error { // 更新邀请记录 @@ -54,7 +55,7 @@ func CpInviteCancelInit() { }) if err != nil { model.Log.Errorf("CpInviteCancelInit invite:%+v, err:%v", v, err) - return + continue } time.Sleep(time.Millisecond * 10) } @@ -66,6 +67,7 @@ func CpInviteCancelInit() { return } for _, v := range cancelList { + model := domain.CreateModelContext(model.MyContext) model.Log.Infof("CpInviteCancelInit cancel:%+v", v) err = model.Transaction(func(model *domain.Model) error { // 更新解除记录 @@ -84,7 +86,7 @@ func CpInviteCancelInit() { }) if err != nil { model.Log.Errorf("CpInviteCancelInit cancel:%+v, err:%v", v, err) - return + continue } time.Sleep(time.Millisecond * 10) } diff --git a/cron/cron.go b/cron/cron.go index f9256e3..eeef2b4 100644 --- a/cron/cron.go +++ b/cron/cron.go @@ -2,7 +2,6 @@ package cron import ( "git.hilo.cn/hilo-common/resource/config" - "hilo-user/corn/cp_corn" "hilo-user/cron/cp_cron" "hilo-user/cron/gift_cron" ) @@ -15,5 +14,5 @@ func Init() { gift_cron.GiftRemark() // 礼物消息补偿 cp_cron.ClearCpExpire() // 清理过期cp cp_cron.CpAnniversaryNotice() // cp纪念日 - cp_corn.CpInviteCancelInit() // cp邀请、解除到期结算 + cp_cron.CpInviteCancelInit() // cp邀请、解除到期结算 } -- 2.22.0