#369 Instance list persisted on disk if enabled.

This commit is contained in:
nkorange 2018-11-30 13:24:03 +08:00
parent 9d8db9799d
commit c2672953d2
2 changed files with 8 additions and 2 deletions

View File

@ -102,6 +102,10 @@ public class UtilsAndCommons {
public static final String API_DOM = "/api/dom";
public static final String INSTANCE_LIST_PERSISTED_PROPERTY_KEY = "NacosNamingInstanceListPersisted";
public static final boolean INSTANCE_LIST_PERSISTED = Boolean.getBoolean(INSTANCE_LIST_PERSISTED_PROPERTY_KEY);
public static final ScheduledExecutorService SERVER_STATUS_EXECUTOR;
public static final ScheduledExecutorService DOMAIN_SYNCHRONIZATION_EXECUTOR;

View File

@ -396,9 +396,10 @@ public class RaftCore {
}
// do apply
if (datum.key.startsWith(UtilsAndCommons.DOMAINS_DATA_ID)) {
if (datum.key.startsWith(UtilsAndCommons.DOMAINS_DATA_ID) || UtilsAndCommons.INSTANCE_LIST_PERSISTED) {
RaftStore.write(datum);
}
RaftCore.datums.put(datum.key, datum);
if (datum.key.startsWith(UtilsAndCommons.DOMAINS_DATA_ID)) {
@ -797,7 +798,8 @@ public class RaftCore {
continue;
}
if (datum.key.startsWith(UtilsAndCommons.DOMAINS_DATA_ID)) {
if (datum.key.startsWith(UtilsAndCommons.DOMAINS_DATA_ID) ||
UtilsAndCommons.INSTANCE_LIST_PERSISTED) {
RaftStore.write(datum);
}