Merge pull request #1002 from alibaba/hotfix_remove_service_failed

#961 init cluster after instantiate cluster
This commit is contained in:
Fury Zhu 2019-04-04 10:40:35 +08:00 committed by GitHub
commit 53d154d6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,9 @@ public class Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implement
} }
public void destroy() { public void destroy() {
checkTask.setCancelled(true); if (checkTask != null) {
checkTask.setCancelled(true);
}
} }
public HealthCheckTask getHealthCheckTask() { public HealthCheckTask getHealthCheckTask() {

View File

@ -217,6 +217,7 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement
instance.getClusterName(), instance.toJSON()); instance.getClusterName(), instance.toJSON());
Cluster cluster = new Cluster(instance.getClusterName()); Cluster cluster = new Cluster(instance.getClusterName());
cluster.setService(this); cluster.setService(this);
cluster.init();
getClusterMap().put(instance.getClusterName(), cluster); getClusterMap().put(instance.getClusterName(), cluster);
} }