fix: execute in local when there is no address info for one app

This commit is contained in:
tjq 2021-03-21 19:18:22 +08:00
parent 0adb16011c
commit f5afff56c4
4 changed files with 9 additions and 3 deletions

View File

@ -23,6 +23,7 @@ public class AskResponse implements PowerSerializable {
/*
- 使用 Object 会报错java.lang.ClassCastException: scala.collection.immutable.HashMap cannot be cast to XXX只能自己序列化反序列化了
- 嵌套类型比如 Map<String, B>如果B也是个复杂对象那么反序列化后B的类型为 LinkedHashMap... 处理比较麻烦转成JSON再转回来
- 考虑到多语言通讯data 必须使用 JSON 序列化为字节数组
*/
private byte[] data;

View File

@ -77,6 +77,11 @@ public class DesignateServerAspect {
AppInfoDO appInfo = appInfoRepository.findById(appId).orElseThrow(() -> new PowerJobException("can't find app info"));
String targetServer = appInfo.getCurrentServer();
// 目标IP为空本地执行
if (StringUtils.isEmpty(targetServer)) {
return point.proceed();
}
// 目标IP与本地符合则本地执行
if (Objects.equals(targetServer, AkkaStarter.getActorSystemAddress())) {
return point.proceed();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long