Skip to content

Commit

Permalink
Merge 7853f4c into 61cda00
Browse files Browse the repository at this point in the history
  • Loading branch information
laijianbin committed May 17, 2018
2 parents 61cda00 + 7853f4c commit 2230abc
Showing 1 changed file with 1 addition and 17 deletions.
Expand Up @@ -46,8 +46,6 @@
import org.apache.servicecomb.serviceregistry.task.MicroserviceServiceCenterTask;
import org.apache.servicecomb.serviceregistry.task.ServiceCenterTask;
import org.apache.servicecomb.serviceregistry.task.event.ShutdownEvent;
import org.apache.servicecomb.serviceregistry.version.Version;
import org.apache.servicecomb.serviceregistry.version.VersionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -183,25 +181,11 @@ public void run() {
private void loadFrameworkVersions() {
Framework framework = new Framework();
framework.setName(CONFIG_FRAMEWORK_DEFAULT_NAME);

if (needSetFrameworkVersion()) {
framework.setVersion(FrameworkVersions.allVersions());
}
framework.setVersion(FrameworkVersions.allVersions());
microservice.setFramework(framework);
microservice.setRegisterBy(CONFIG_DEFAULT_REGISTER_BY);
}

private boolean needSetFrameworkVersion() {
if (serviceCenterInfo == null) {
LOGGER.warn("Server startup when service center not started and cannot retrieve version info, assume latest.");
return true;
}

Version scVersion = VersionUtils.getOrCreate(serviceCenterInfo.getVersion());
Version frameworkVersion = VersionUtils.getOrCreate(Const.SERVICECENTER_FRAMEWORK_VERSION);
return scVersion.compareTo(frameworkVersion) >= 0;
}

private void loadStaticConfiguration() {
// TODO 如果yaml定义了paths规则属性,替换默认值,现需要DynamicPropertyFactory支持数组获取
List<BasePath> paths = microservice.getPaths();
Expand Down

0 comments on commit 2230abc

Please sign in to comment.