Commit 0b94d9af82f37eadbedbf265c5958d64278897cc
Merge remote-tracking branch 'origin/test'
Showing
2 changed files
with
2 additions
and
3 deletions
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/bus/cust/CustomerChangeBizService.java
... | ... | @@ -119,8 +119,7 @@ public class CustomerChangeBizService extends AbstractCustomerService { |
119 | 119 | String key = MessageFormatUtil.MessageFormatTransfer(CUSTOMER_CHANGE_CODE, customerChangeDto.getShopId(), str); |
120 | 120 | String customerString = JSON.toJSONString(customerChangeDto); |
121 | 121 | Pair<Boolean, RLock> lockPair = distributedLocker.tryLock(key, TimeUnit.SECONDS, 0, 1000 * 15); |
122 | - RLock rLock = lockPair.getRight(); | |
123 | - boolean flag = rLock.isLocked(); | |
122 | + boolean flag = lockPair.getKey(); | |
124 | 123 | BV.isTrue(flag, "重复操作,请稍后重试"); |
125 | 124 | int expires = 60 * 30; |
126 | 125 | stringRedisTemplate.opsForValue().set(key, customerString, expires, TimeUnit.SECONDS); | ... | ... |
fw-valhalla-service/src/main/java/cn/fw/valhalla/service/report/PublicReportBizService.java
... | ... | @@ -63,7 +63,7 @@ public class PublicReportBizService { |
63 | 63 | log.info("开始抽取公共池报表数据,日期:{} 集团:{}", nowDate, groupId); |
64 | 64 | final String lockKey = generateKey(groupId); |
65 | 65 | RLock lock = (RLock) distributedLocker.lock(lockKey); |
66 | - if (lock == null || !lock.isLocked()) { | |
66 | + if (lock == null || !lock.isLocked() || !lock.isHeldByCurrentThread()) { | |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | try { | ... | ... |