From 25f747e1912c17b2f934f73094bf48426645a0c9 Mon Sep 17 00:00:00 2001 From: iamhujiebin <458249864@qq.com> Date: Mon, 24 Jul 2023 23:49:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8D=95=E4=BC=98=E5=8C=96=E5=8A=BF?= =?UTF-8?q?=E5=8A=9B=E7=BB=8F=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/service/event_s/event_init.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/domain/service/event_s/event_init.go b/domain/service/event_s/event_init.go index 4ec3856..dfb6406 100644 --- a/domain/service/event_s/event_init.go +++ b/domain/service/event_s/event_init.go @@ -468,7 +468,7 @@ func FlushHiloInfo(extId string, isVip bool, isPrettyCode bool, medals []uint32, func SendGift() { // 送礼事件-势力经验 - gift_ev.AddSendGiftEventSync(func(model *domain.Model, event interface{}) error { + gift_ev.AddSendGiftEventAsync(func(model *domain.Model, event interface{}) error { sendGiftEvent, ok := event.(*gift_ev.SendGiftEvent) if !ok { model.Log.Errorf("AddSendGiftEventAsync event type err") @@ -485,7 +485,9 @@ func SendGift() { } if exist { exp := sendGiftEvent.GiftN * mysql.Num(len(sendGiftEvent.ReceiveUserIds)) * sendGiftEvent.ResGift.DiamondNum - return groupPower_m.IncrGroupPowerExp(model, groupPowerId, exp, sendGiftEvent.SendUserId, "送礼") + return model.Transaction(func(model *domain.Model) error { + return groupPower_m.IncrGroupPowerExp(model, groupPowerId, exp, sendGiftEvent.SendUserId, "送礼") + }) } return nil }) -- 2.22.0