mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
fix: execute in local when there is no address info for one app
This commit is contained in:
parent
0adb16011c
commit
f5afff56c4
@ -23,6 +23,7 @@ public class AskResponse implements PowerSerializable {
|
|||||||
/*
|
/*
|
||||||
- 使用 Object 会报错:java.lang.ClassCastException: scala.collection.immutable.HashMap cannot be cast to XXX,只能自己序列化反序列化了
|
- 使用 Object 会报错:java.lang.ClassCastException: scala.collection.immutable.HashMap cannot be cast to XXX,只能自己序列化反序列化了
|
||||||
- 嵌套类型(比如 Map<String, B>),如果B也是个复杂对象,那么反序列化后B的类型为 LinkedHashMap... 处理比较麻烦(转成JSON再转回来)
|
- 嵌套类型(比如 Map<String, B>),如果B也是个复杂对象,那么反序列化后B的类型为 LinkedHashMap... 处理比较麻烦(转成JSON再转回来)
|
||||||
|
- 考虑到多语言通讯,data 必须使用 JSON 序列化为字节数组
|
||||||
*/
|
*/
|
||||||
private byte[] data;
|
private byte[] data;
|
||||||
|
|
||||||
|
@ -77,6 +77,11 @@ public class DesignateServerAspect {
|
|||||||
AppInfoDO appInfo = appInfoRepository.findById(appId).orElseThrow(() -> new PowerJobException("can't find app info"));
|
AppInfoDO appInfo = appInfoRepository.findById(appId).orElseThrow(() -> new PowerJobException("can't find app info"));
|
||||||
String targetServer = appInfo.getCurrentServer();
|
String targetServer = appInfo.getCurrentServer();
|
||||||
|
|
||||||
|
// 目标IP为空,本地执行
|
||||||
|
if (StringUtils.isEmpty(targetServer)) {
|
||||||
|
return point.proceed();
|
||||||
|
}
|
||||||
|
|
||||||
// 目标IP与本地符合则本地执行
|
// 目标IP与本地符合则本地执行
|
||||||
if (Objects.equals(targetServer, AkkaStarter.getActorSystemAddress())) {
|
if (Objects.equals(targetServer, AkkaStarter.getActorSystemAddress())) {
|
||||||
return point.proceed();
|
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
Loading…
x
Reference in New Issue
Block a user