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();
|
checkIsStopWork();
|
||||||
try {
|
try {
|
||||||
if (KeyBuilder.matchInstanceListKey(key) && !raftCore.isLeader()) {
|
if (KeyBuilder.matchInstanceListKey(key) && !raftCore.isLeader()) {
|
||||||
Datum datum = new Datum();
|
raftCore.onDelete(key, peers.getLeader());
|
||||||
datum.key = key;
|
} else {
|
||||||
raftCore.onDelete(datum.key, peers.getLeader());
|
raftCore.signalDelete(key);
|
||||||
raftCore.unlistenAll(key);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
raftCore.signalDelete(key);
|
|
||||||
raftCore.unlistenAll(key);
|
raftCore.unlistenAll(key);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Loggers.RAFT.error("Raft remove failed.", 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.Datum;
|
||||||
import com.alibaba.nacos.naming.consistency.KeyBuilder;
|
import com.alibaba.nacos.naming.consistency.KeyBuilder;
|
||||||
import com.alibaba.nacos.naming.consistency.RecordListener;
|
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.RaftPeer;
|
||||||
import com.alibaba.nacos.naming.consistency.persistent.raft.RaftPeerSet;
|
import com.alibaba.nacos.naming.consistency.persistent.raft.RaftPeerSet;
|
||||||
import com.alibaba.nacos.naming.misc.GlobalExecutor;
|
import com.alibaba.nacos.naming.misc.GlobalExecutor;
|
||||||
|
Loading…
Reference in New Issue
Block a user