refactoring

pull/1124/head
Nikita 7 years ago
parent ea933127c5
commit 901b491106

@ -145,6 +145,17 @@ public class MasterSlaveEntry {
entry.reset();
closeConnections(entry);
for (RedisPubSubConnection connection : entry.getAllSubscribeConnections()) {
reattachPubSub(connection, temporaryDown);
}
entry.getAllSubscribeConnections().clear();
return true;
}
private void closeConnections(ClientConnectionsEntry entry) {
// close all connections
while (true) {
final RedisConnection connection = entry.pollConnection();
@ -168,13 +179,6 @@ public class MasterSlaveEntry {
}
connection.closeAsync();
}
for (RedisPubSubConnection connection : entry.getAllSubscribeConnections()) {
reattachPubSub(connection, temporaryDown);
}
entry.getAllSubscribeConnections().clear();
return true;
}
private void reattachPubSub(RedisPubSubConnection redisPubSubConnection, boolean temporaryDown) {

Loading…
Cancel
Save