Commit 9cc95e843ab825351626703912070e9fb98af68f

Authored by 张志伟
2 parents a52b1992 6ff5064c

Merge remote-tracking branch 'origin/test'

fw-hermes-service/src/main/java/cn/fw/hermes/service/biz/AppUpdateBizService.java
1 1 package cn.fw.hermes.service.biz;
2 2  
3 3 import cn.fw.common.cache.locker.DistributedLocker;
  4 +import cn.fw.common.cache.locker.FLock;
4 5 import cn.fw.common.web.annotation.DisLock;
5 6 import cn.fw.hermes.common.constant.Constant;
6 7 import cn.fw.hermes.domain.db.AppUpdateMsg;
... ... @@ -17,7 +18,6 @@ import lombok.Getter;
17 18 import lombok.RequiredArgsConstructor;
18 19 import lombok.extern.slf4j.Slf4j;
19 20 import org.apache.commons.lang3.tuple.Pair;
20   -import org.redisson.api.RLock;
21 21 import org.springframework.beans.factory.annotation.Value;
22 22 import org.springframework.cloud.context.config.annotation.RefreshScope;
23 23 import org.springframework.stereotype.Service;
... ... @@ -77,7 +77,7 @@ public class AppUpdateBizService {
77 77 */
78 78 public void reSendUpdateMsg() {
79 79 final String lockKey = getKeyPrefix() + ":resend";
80   - Pair<Boolean, RLock> lockPair = distributedLocker.tryLock(lockKey, TimeUnit.MINUTES, 0, -1);
  80 + Pair<Boolean, FLock> lockPair = distributedLocker.tryLock(lockKey, TimeUnit.MINUTES, 0, -1);
81 81 try {
82 82 if (Boolean.TRUE.equals(lockPair.getLeft())) {
83 83 List<AppUpdateMsg> list = appUpdateMsgService.list(Wrappers.<AppUpdateMsg>lambdaQuery()
... ... @@ -97,7 +97,7 @@ public class AppUpdateBizService {
97 97 } catch (Exception e) {
98 98 log.error("重发更新消息失败", e);
99 99 } finally {
100   - if (lockPair.getRight().isLocked()) {
  100 + if (lockPair.getLeft()) {
101 101 lockPair.getRight().unlock();
102 102 }
103 103 }
... ...
... ... @@ -12,7 +12,7 @@
12 12 <parent>
13 13 <groupId>cn.fw</groupId>
14 14 <artifactId>fw-common-dependencies</artifactId>
15   - <version>3.6.0</version>
  15 + <version>3.6.1</version>
16 16 </parent>
17 17  
18 18 <modules>
... ...