fix: test mode can't startup when server not available #580

This commit is contained in:
tjq 2023-03-16 23:35:10 +08:00
parent 0a76d057ac
commit 4b79bd73bb
2 changed files with 6 additions and 1 deletions

View File

@ -30,7 +30,10 @@ public class ServerDiscoveryRequest implements Serializable {
public Map<String, Object> toMap() {
Map<String, Object> ret = new HashMap<>();
ret.put("appId", appId);
// testMode appId 可能为空此处不判断会导致 testMode 无法启动 #580
if (appId != null) {
ret.put("appId", appId);
}
ret.put("protocol", protocol);
if (StringUtils.isNotEmpty(currentServer)) {
ret.put("currentServer", currentServer);

View File

@ -3,6 +3,8 @@ spring.jpa.open-in-view=false
########### PowerJob-worker properties. ###########
# Whether to enable PowerJob Worker, default is true
powerjob.worker.enabled=true
# Turn on test mode and do not force the server connection to be verified
powerjob.worker.enable-test-mode=true
# Transport port, default is 27777
powerjob.worker.port=27777
# Application name, used for grouping applications. Recommend to set the same value as project name.