From e9c1c63a699879b61d91ac73c91897f41cd56dcd Mon Sep 17 00:00:00 2001 From: ziming Date: Tue, 1 Jul 2025 18:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=AD=A611?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/warning_budget.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/biz/warning_budget.go b/internal/biz/warning_budget.go index 540b90b..a11d2b6 100644 --- a/internal/biz/warning_budget.go +++ b/internal/biz/warning_budget.go @@ -12,11 +12,6 @@ import ( "voucher/internal/biz/vo" ) -func (this *VoucherBiz) WarningBudgetIncrKv(uid string) (string, time.Duration) { - v := vo.WarningBudgetSendIncr.BuildCache([]string{uid}) - return v.Key, v.TTL -} - func (this *VoucherBiz) WarningBudgetIncr(ctx context.Context, key string, ttl time.Duration) (int64, error) { // 增加发送计数 @@ -118,7 +113,9 @@ func (this *VoucherBiz) Calculate(ctx context.Context, product *bo.ProductBo, wx w := this.WxResp(wxResp) - key, ttl := this.WarningBudgetIncrKv(product.BatchNo) + b := vo.WarningBudgetSendIncr.BuildCache([]string{product.BatchNo}) + key := b.Key + ttl := b.TTL if w.AllBudget > product.AllBudget { if err := this.WarningBudgetIncrDel(ctx, key); err != nil {