Skip to content

Commit 1523c1b

Browse files
authored
address code review comments (zio#923)
1 parent 702e1cd commit 1523c1b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

modules/redis/src/main/scala/zio/redis/internal/ClusterExecutor.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private[redis] final class ClusterExecutor private (
5151
case success => ZIO.succeed(success)
5252
}.catchSome[Any, RedisError, RespValue] {
5353
case e: RedisError.Ask => executeAsk(e.address)
54-
case _: RedisError.Moved => refreshConnect(config.requestQueueSize) *> execute(keySlot)
54+
case _: RedisError.Moved => refreshConnect *> execute(keySlot)
5555
}
5656
recover.retry(retryPolicy)
5757
}
@@ -79,11 +79,11 @@ private[redis] final class ClusterExecutor private (
7979
ZIO.fromOption(executorOpt).catchAll(_ => enrichedClusterIO)
8080
}
8181

82-
private def refreshConnect(requestQueueSize: Int): IO[RedisError, Unit] =
82+
private def refreshConnect: IO[RedisError, Unit] =
8383
clusterConnection.updateZIO { connection =>
8484
val addresses = connection.partitions.flatMap(_.addresses)
8585
for {
86-
cluster <- scope.extend[Any](initConnectToCluster(addresses, requestQueueSize))
86+
cluster <- scope.extend[Any](initConnectToCluster(addresses, config.requestQueueSize))
8787
_ <- ZIO.foreachParDiscard(connection.executors) { case (_, es) => es.scope.close(Exit.unit) }
8888
} yield cluster
8989
}

modules/redis/src/main/scala/zio/redis/internal/RedisConnection.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private[redis] object RedisConnection {
7575
ZLayer.scoped(ZIO.serviceWithZIO[RedisConfig](create))
7676

7777
lazy val local: ZLayer[Any, IOError, RedisConfig & RedisConnection] =
78-
ZLayer.succeed(RedisConfig.Local) >+> layer
78+
ZLayer.make[RedisConfig & RedisConnection](ZLayer.succeed(RedisConfig.Local), layer)
7979

8080
def create(uri: RedisConfig): ZIO[Scope, RedisError.IOError, RedisConnection] =
8181
connect(new InetSocketAddress(uri.host, uri.port))

modules/redis/src/main/scala/zio/redis/internal/SingleNodeExecutor.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private[redis] object SingleNodeExecutor {
6767
RedisConnection.layer >>> makeLayer
6868

6969
def local: ZLayer[Any, RedisError.IOError, RedisExecutor] =
70-
ZLayer.succeed(RedisConfig.Local) >>> layer
70+
ZLayer.make[RedisExecutor](ZLayer.succeed(RedisConfig.Local), layer)
7171

7272
def create(connection: RedisConnection): URIO[Scope & RedisConfig, SingleNodeExecutor] =
7373
for {

0 commit comments

Comments
 (0)