From 13040896b9183bcee2cd30d13410f3758dab63ba Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Tue, 29 Oct 2024 14:14:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/lotterymgr.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index dc1153c..b695963 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -214,14 +214,21 @@ func (l *LotteryData) sendRobotCode(a, b int) { // Done 抽奖 func (l *LotteryData) Done() { + if l.isDone { + return + } + l.isDone = true + now := time.Now() if l.EndTs <= 0 || l.EndTs >= now.Unix() || l.SnId > 0 || now.Unix()-l.EndTs > 5*60 { + l.isDone = false return } sTs := common.GetDayStartTs(now.Unix()) eTs := sTs + int64(time.Hour.Seconds()*24) if l.StartTs < sTs || l.StartTs >= eTs { + l.isDone = false return } @@ -292,11 +299,6 @@ 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)