修改cus日志输出范围,分布式锁新增添加新增失败可能是其他服务器抢占的逻辑控制

main
youHong.ai 2022-12-11 22:57:35 +08:00
parent 2d4bce9513
commit 8e8b6376e6
2 changed files with 10 additions and 2 deletions

View File

@ -2080,6 +2080,7 @@ public class Util extends weaver.general.Util {
appender.setAppend(true);
appender.activateOptions();
log.addAppender(appender);
log.setAdditivity(false);
log.setLevel(Level.INFO);
/*
boolean enableDebug = false;
@ -2127,6 +2128,7 @@ public class Util extends weaver.general.Util {
appender.setAppend(true);
appender.activateOptions();
cusLog.addAppender(appender);
cusLog.setAdditivity(false);
/*
boolean enableDebug = false;
try {

View File

@ -242,8 +242,14 @@ public class LockUtils {
.build();
LOCK_MAP.put(lockName, lockEntity);
} else {
// 锁失败
retryLock(dataId, lockName, expirationTime, 0);
LockPojo lockPojo = mapper.selectLock(lockName);
if (Objects.isNull(lockPojo)) {
// 锁失败
retryLock(dataId, lockName, expirationTime, 0);
} else {
// 其他服务器抢占了锁资源
return retryGetLock(lockName, overdueTime, lockPojo);
}
}
return true;
}