From b0862c55fc597bf6748ea5c283c52583bfe77c06 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 28 Jun 2026 15:23:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E6=8A=A2?= =?UTF-8?q?=E8=B4=AD=E5=89=8D=E7=AB=AF=E6=98=BE=E7=A4=BA=E2=80=9C=E5=89=A9?= =?UTF-8?q?=E4=BD=99=20undefined=20=E7=A7=92=E2=80=9D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前移除手动提前量时误删了 remainSecond 返回值,前端仍依赖该字段显示倒计时 --- internal/seckill/scheduler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/seckill/scheduler.go b/internal/seckill/scheduler.go index c07b821..df1067a 100644 --- a/internal/seckill/scheduler.go +++ b/internal/seckill/scheduler.go @@ -5,6 +5,7 @@ import ( "bytes" "errors" "fmt" + "math" "math/rand" "os" "path/filepath" @@ -1193,6 +1194,7 @@ func (s *Scheduler) ScheduleRun(req types.SeckillRequest) (map[string]any, error "success": true, "targetTime": targetTime.In(constants.CST).Format("2006-01-02 15:04:05"), "triggerTime": triggerTime.In(constants.CST).Format("2006-01-02 15:04:05"), + "remainSecond": int(math.Ceil(remain.Seconds())), "offsetMs": calibration.Offset.Milliseconds(), "errorBoundMs": calibration.ErrorBound.Milliseconds(), "rttMs": calibration.RTT.Milliseconds(),