From 48b5d897d64b914c581742949f23b285c8f4657a Mon Sep 17 00:00:00 2001 From: ziming Date: Mon, 31 Mar 2025 11:36:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E9=94=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/notify_retry_consume.go | 4 ++-- internal/biz/vo/cache.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/biz/notify_retry_consume.go b/internal/biz/notify_retry_consume.go index e516739..d5880f8 100644 --- a/internal/biz/notify_retry_consume.go +++ b/internal/biz/notify_retry_consume.go @@ -35,10 +35,10 @@ func (v *VoucherBiz) NotifyRetryConsume(ctx context.Context, orderNotifyId uint6 var ( err error orderNotify *bo.OrderNotifyBo - cache = vo.NotifyRetryConsume.BuildCacheUint64([]uint64{orderNotifyId}) + c = vo.NotifyRetryConsume.BuildCacheUint64([]uint64{orderNotifyId}) ) - err = lock.NewMutex(v.rdb.Rdb, cache.TTL).Lock(ctx, cache.Key, func(ctx context.Context) error { + err = lock.NewMutex(v.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error { orderNotify, err = v.OrderNotifyRepo.GetByID(ctx, orderNotifyId) if err != nil { diff --git a/internal/biz/vo/cache.go b/internal/biz/vo/cache.go index 2fa2ea0..e2b5120 100644 --- a/internal/biz/vo/cache.go +++ b/internal/biz/vo/cache.go @@ -58,10 +58,10 @@ func (s CacheKey) GetValue() string { func (s CacheKey) BuildCache(strArr []string) *Cache { - k := "" + k := s.GetValue() if len(strArr) > 0 { - k = helper.BuildStr(s.GetValue(), strArr) + k = helper.BuildStr(k, strArr) } c := &Cache{ @@ -80,10 +80,10 @@ func (s CacheKey) BuildCache(strArr []string) *Cache { func (s CacheKey) BuildCacheUint64(ids []uint64) *Cache { - k := "" + k := s.GetValue() if len(ids) > 0 { - k = helper.BuildStr(s.GetValue(), ids) + k = helper.BuildStr(k, ids) } c := &Cache{