From 6aedff2fa6bd1ab5437b08068f07beec313436ff Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 27 May 2024 15:42:51 +0800 Subject: [PATCH] Changes --- .../com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java index f1d0ae6..176f85a 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java @@ -111,9 +111,9 @@ public class GoodsMsgServiceImpl implements GoodsMsgService { try { // 分布式锁占坑 Boolean lock = redisTemplate.opsForValue().setIfAbsent(key, goodsId); - + System.out.println("==========================================================lock" + lock); GoodsMsg goodsMsg = queryDetail(goodsId); - + System.out.println("==========================================================goodsMsg" + goodsMsg); if (goodsMsg != null) { if(Boolean.TRUE.equals(lock)) { @@ -126,6 +126,7 @@ public class GoodsMsgServiceImpl implements GoodsMsgService { update(goodsMsg); } else { + System.out.println("==========================================================加锁失败,重试"); // 加锁失败,重试 Thread.sleep(100); editSaleNum(goodsId , num , type);