From 0a67496d500fd42df2fa46660b2f5409739e848b Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 29 Oct 2024 09:07:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E6=8A=BD?= =?UTF-8?q?=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/lotterymgr.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index 3b1609c..f729219 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -53,6 +53,7 @@ func init() { // LotteryData 抽奖数据 type LotteryData struct { *model.LotteryData + isDone bool // 抽奖中 } // Reset 重置抽奖数据 @@ -287,6 +288,11 @@ func (l *LotteryData) Done() { value, tp, index, l.RobotIndex, l.Code, l.PlayerIndex, l.CId) } + if l.isDone { + return + } + l.isDone = true + task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { // 查询参与人数 joinNum, err = model.GetLotteryCodeJoinNum(l.Platform, l.CId, l.StartTs) @@ -333,6 +339,9 @@ func (l *LotteryData) Done() { } return nil }), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) { + defer func() { + l.isDone = false + }() if code == nil && isMust { code = &model.LotteryCode{ Platform: l.Platform,