预警11
This commit is contained in:
parent
cb61887221
commit
e9c1c63a69
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue