Compare commits

...

1 Commits

Author SHA1 Message Date
ayflying
788cb2e6d4 持久化失败会提前结束任务进行抛错 2025-08-27 10:31:48 +08:00

View File

@@ -212,7 +212,7 @@ func (s *sGameAct) Save(ctx context.Context, actId int) (err error) {
if len(delKey) > 0 {
for _, v := range update {
v.UpdatedAt = gtime.Now()
_, err2 := g.Model(Name).Where(do.GameAct{
updateRes, err2 := g.Model(Name).Where(do.GameAct{
Uid: v.Uid,
ActId: v.ActId,
}).Data(v).Update()
@@ -220,6 +220,10 @@ func (s *sGameAct) Save(ctx context.Context, actId int) (err error) {
g.Log().Error(ctx, err2)
return
}
if row, _ := updateRes.RowsAffected(); row == 0 {
g.Log().Error(ctx, "本次更新为0更新数据失败: %v", v)
return
}
}
update = make([]*entity.GameAct, 0)
var count int64