Move remove listener logic to ServiceManager
This commit is contained in:
parent
b8b111320a
commit
b3b6c30ef0
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user