Move remove listener logic to ServiceManager

This commit is contained in:
KomachiSion 2020-10-12 16:00:50 +08:00
parent b8b111320a
commit b3b6c30ef0
2 changed files with 3 additions and 7 deletions

View File

@ -95,13 +95,10 @@ public class RaftConsistencyServiceImpl implements PersistentConsistencyService
checkIsStopWork();
try {
if (KeyBuilder.matchInstanceListKey(key) && !raftCore.isLeader()) {
Datum datum = new Datum();
datum.key = key;
raftCore.onDelete(datum.key, peers.getLeader());
raftCore.unlistenAll(key);
return;
raftCore.onDelete(key, peers.getLeader());
} else {
raftCore.signalDelete(key);
}
raftCore.signalDelete(key);
raftCore.unlistenAll(key);
} catch (Exception e) {
Loggers.RAFT.error("Raft remove failed.", e);

View File

@ -26,7 +26,6 @@ import com.alibaba.nacos.naming.consistency.ConsistencyService;
import com.alibaba.nacos.naming.consistency.Datum;
import com.alibaba.nacos.naming.consistency.KeyBuilder;
import com.alibaba.nacos.naming.consistency.RecordListener;
import com.alibaba.nacos.naming.consistency.persistent.impl.PersistentServiceProcessor;
import com.alibaba.nacos.naming.consistency.persistent.raft.RaftPeer;
import com.alibaba.nacos.naming.consistency.persistent.raft.RaftPeerSet;
import com.alibaba.nacos.naming.misc.GlobalExecutor;