Commit 7778a3de authored by hujiebin's avatar hujiebin

Merge branch 'fix/cp_cancel_cron' into 'master'

cp解除

See merge request !20
parents 549ced37 211fbd1b
package cp_corn package cp_cron
import ( import (
"git.hilo.cn/hilo-common/_const/enum/diamond_e" "git.hilo.cn/hilo-common/_const/enum/diamond_e"
...@@ -36,6 +36,7 @@ func CpInviteCancelInit() { ...@@ -36,6 +36,7 @@ func CpInviteCancelInit() {
return return
} }
for _, v := range inviteList { for _, v := range inviteList {
model := domain.CreateModelContext(model.MyContext)
model.Log.Infof("CpInviteCancelInit invite:%+v", v) model.Log.Infof("CpInviteCancelInit invite:%+v", v)
err = model.Transaction(func(model *domain.Model) error { err = model.Transaction(func(model *domain.Model) error {
// 更新邀请记录 // 更新邀请记录
...@@ -54,7 +55,7 @@ func CpInviteCancelInit() { ...@@ -54,7 +55,7 @@ func CpInviteCancelInit() {
}) })
if err != nil { if err != nil {
model.Log.Errorf("CpInviteCancelInit invite:%+v, err:%v", v, err) model.Log.Errorf("CpInviteCancelInit invite:%+v, err:%v", v, err)
return continue
} }
time.Sleep(time.Millisecond * 10) time.Sleep(time.Millisecond * 10)
} }
...@@ -66,6 +67,7 @@ func CpInviteCancelInit() { ...@@ -66,6 +67,7 @@ func CpInviteCancelInit() {
return return
} }
for _, v := range cancelList { for _, v := range cancelList {
model := domain.CreateModelContext(model.MyContext)
model.Log.Infof("CpInviteCancelInit cancel:%+v", v) model.Log.Infof("CpInviteCancelInit cancel:%+v", v)
err = model.Transaction(func(model *domain.Model) error { err = model.Transaction(func(model *domain.Model) error {
// 更新解除记录 // 更新解除记录
...@@ -84,7 +86,7 @@ func CpInviteCancelInit() { ...@@ -84,7 +86,7 @@ func CpInviteCancelInit() {
}) })
if err != nil { if err != nil {
model.Log.Errorf("CpInviteCancelInit cancel:%+v, err:%v", v, err) model.Log.Errorf("CpInviteCancelInit cancel:%+v, err:%v", v, err)
return continue
} }
time.Sleep(time.Millisecond * 10) time.Sleep(time.Millisecond * 10)
} }
......
...@@ -2,7 +2,6 @@ package cron ...@@ -2,7 +2,6 @@ package cron
import ( import (
"git.hilo.cn/hilo-common/resource/config" "git.hilo.cn/hilo-common/resource/config"
"hilo-user/corn/cp_corn"
"hilo-user/cron/cp_cron" "hilo-user/cron/cp_cron"
"hilo-user/cron/gift_cron" "hilo-user/cron/gift_cron"
) )
...@@ -15,5 +14,5 @@ func Init() { ...@@ -15,5 +14,5 @@ func Init() {
gift_cron.GiftRemark() // 礼物消息补偿 gift_cron.GiftRemark() // 礼物消息补偿
cp_cron.ClearCpExpire() // 清理过期cp cp_cron.ClearCpExpire() // 清理过期cp
cp_cron.CpAnniversaryNotice() // cp纪念日 cp_cron.CpAnniversaryNotice() // cp纪念日
cp_corn.CpInviteCancelInit() // cp邀请、解除到期结算 cp_cron.CpInviteCancelInit() // cp邀请、解除到期结算
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment