mirror of
https://gitee.com/BDWare/cp.git
synced 2025-12-28 01:49:26 +00:00
feat: the startup parameter prioritizes the doipStartPort specified in the configuration
This commit is contained in:
@@ -91,6 +91,16 @@ public class DoipLocalSingleton {
|
||||
SharableVarManager.initSharableVarManager(repoID, config);
|
||||
}
|
||||
}
|
||||
// 如果启动参数中添加了 doipStartPort 参数,使用该参数作为启动端口
|
||||
if (otherConfigs != null && otherConfigs.isJsonObject() && otherConfigs.getAsJsonObject().has("doipStartPort") && infos.size() == 1) {
|
||||
int doipStartPort = otherConfigs.getAsJsonObject().get("doipStartPort").getAsInt();
|
||||
// 如果当前启动的端口和指定的端口不一致,修改启动端口
|
||||
if (doipStartPort != port) {
|
||||
infos.get(0).url = infos.get(0).url.replace(String.valueOf(port), String.valueOf(doipStartPort));
|
||||
port = doipStartPort;
|
||||
}
|
||||
}
|
||||
|
||||
DoipServiceInfo info = new DoipServiceInfo(repoID, owner, repoType, infos);
|
||||
server = new DoipServerImpl(info);
|
||||
DOOPRequestHandler handler = ContractProcess.instance.doopRequestHandler;
|
||||
|
||||
Reference in New Issue
Block a user