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