Merge remote-tracking branch 'origin/fix-bug-202303' into fix-bug-202303

This commit is contained in:
梁琦涛
2023-03-09 17:37:31 +08:00
6 changed files with 8 additions and 5 deletions
@@ -10,6 +10,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
/**
* 定时任务配置
@@ -21,7 +23,7 @@ import org.springframework.context.annotation.Configuration;
public class XxlJobConfiguration {
@Autowired
@Resource
private XxlJobProperties xxlJobProperties;
//@Bean(initMethod = "start", destroyMethod = "destroy")
@@ -160,6 +160,7 @@ public class DistributedLockHandler extends BaseAspect{
case WRITE:
rLock = redissonClient.getReadWriteLock(getValueBySpEL(keys[0], parameterNames, args, keyConstant).get(0)).writeLock();
break;
default: break;
}
return rLock;
}
@@ -51,7 +51,7 @@ public class RepeatSubmitAspect extends BaseAspect{
// 获取参数
Object[] args = joinPoint.getArgs();
// 进行一些参数的处理,比如获取订单号,操作人id等
StringBuffer lockKeyBuffer = new StringBuffer();
// StringBuffer lockKeyBuffer = new StringBuffer();
String key =getValueBySpEL(jRepeat.lockKey(), parameterNames, args,"RepeatSubmit").get(0);
// 公平加锁,lockTime后锁自动释放
boolean isLocked = false;
@@ -33,7 +33,7 @@ public class RedissonManager {
public RedissonManager(RedissonProperties redissonProperties) {
//装配开关
Boolean enabled = redissonProperties.getEnabled();
if (enabled) {
if (enabled != null && enabled) {
try {
config = RedissonConfigFactory.getInstance().createConfig(redissonProperties);
redisson = (Redisson) Redisson.create(config);
@@ -43,7 +43,7 @@ public class MasterslaveRedissonConfigStrategyImpl implements RedissonConfigStra
}
slaveList.remove(0);
config.useMasterSlaveServers().addSlaveAddress((String[]) slaveList.toArray());
config.useMasterSlaveServers().addSlaveAddress(slaveList.toArray(new String[0]));
log.info("初始化主从方式Config,redisAddress:" + address);
} catch (Exception e) {
log.error("主从Redisson初始化错误", e);
@@ -12,7 +12,7 @@ public class BaseRabbiMqHandler<T> {
private String token= UserTokenContext.getToken();
public void onMessage(T t, Long deliveryTag, Channel channel, MqListener mqListener) {
public void onMessage(T t, Long deliveryTag, Channel channel, MqListener<T> mqListener) {
try {
UserTokenContext.setToken(token);
mqListener.handler(t, channel);