feat: code review problem modification, ready to release 4.3.4

This commit is contained in:
tjq 2023-08-13 16:31:12 +08:00
parent ad08406d0b
commit 73ebe83c05
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ import tech.powerjob.server.persistence.storage.impl.GridFsService;
import tech.powerjob.server.persistence.storage.impl.MySqlSeriesDfsService; import tech.powerjob.server.persistence.storage.impl.MySqlSeriesDfsService;
/** /**
* Description * 初始化内置的存储服务
* *
* @author tjq * @author tjq
* @since 2023/7/30 * @since 2023/7/30

View File

@ -160,7 +160,8 @@ public class ServerElectionService {
downServerCache.remove(serverAddress); downServerCache.remove(serverAddress);
ProtocolInfo remoteProtocol = protocolInfo.toJavaObject(ProtocolInfo.class); ProtocolInfo remoteProtocol = protocolInfo.toJavaObject(ProtocolInfo.class);
log.info("[ServerElection] server[{}] is active, it will be the master, final protocol={}", serverAddress, remoteProtocol); log.info("[ServerElection] server[{}] is active, it will be the master, final protocol={}", serverAddress, remoteProtocol);
return remoteProtocol.getExternalAddress(); // 4.3.3 升级 4.3.4 过程中未升级的 server 还不存在 externalAddress需要使用 address 兼容
return Optional.ofNullable(remoteProtocol.getExternalAddress()).orElse(remoteProtocol.getAddress());
} else { } else {
log.warn("[ServerElection] server[{}] is active but don't have target protocol", serverAddress); log.warn("[ServerElection] server[{}] is active but don't have target protocol", serverAddress);
} }