Skip to content

Commit 1e069cd

Browse files
authored
Update redis.md
1 parent 3489ed1 commit 1e069cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/md/road-map/redis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public String createOrderByNoLock(OrderAggregate orderAggregate) {
152152
// 模拟锁商品库存
153153
long decrCount = redissonService.decr(skuEntity.getSku());
154154
if (decrCount < 0) return "已无库存[初始化的库存和使用库存,保持一致。orderService.initSkuCount(\"13811216\", 10000);]";
155-
String lockKey = userEntity.getUserId().concat("_").concat(String.valueOf(decrCount));
155+
String lockKey = skuEntity.getSku().concat("_").concat(String.valueOf(decrCount));
156156
RLock lock = redissonService.getLock(lockKey);
157157
try {
158158
lock.lock();

0 commit comments

Comments
 (0)