Correctly return connection future from StaticMasterReplicaConnectionProvider.

We now pass on the connection future when connecting through StaticMasterReplicaConnectionProvider.getConnectionAsync(…).

Closes #2296
This commit is contained in:
Mark Paluch
2022-04-06 14:21:46 +02:00
parent fea6e7842b
commit e0f49370d9
2 changed files with 81 additions and 3 deletions

View File

@@ -90,10 +90,10 @@ class StaticMasterReplicaConnectionProvider implements LettuceConnectionProvider
CompletableFuture<? extends StatefulRedisMasterReplicaConnection<?, ?>> connection = MasterReplica
.connectAsync(client, codec, nodes);
connection.thenApply(it -> {
return connection.thenApply(it -> {
readFrom.ifPresent(readFrom -> it.setReadFrom(readFrom));
return connectionType.cast(connection);
readFrom.ifPresent(it::setReadFrom);
return connectionType.cast(it);
});
}