From aac07d28aadf876c68d33b4042ea205a5f32c8db Mon Sep 17 00:00:00 2001 From: Karel Cemus Date: Tue, 6 Mar 2018 15:47:03 +0100 Subject: [PATCH] Resolved forward reference in RedisCluster --- src/main/scala/redis/RedisCluster.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/redis/RedisCluster.scala b/src/main/scala/redis/RedisCluster.scala index 19c23ccb..8513ec3e 100644 --- a/src/main/scala/redis/RedisCluster.scala +++ b/src/main/scala/redis/RedisCluster.scala @@ -23,6 +23,9 @@ case class RedisCluster(redisServers: Seq[RedisServer], val log = Logging.getLogger(_system, this) + val clusterSlotsRef:Ref[Option[Map[ClusterSlot, RedisConnection]]] = Ref(Option.empty[Map[ClusterSlot, RedisConnection]]) + val lockClusterSlots = Ref(true) + override val redisServerConnections = { redisServers.map { server => makeRedisConnection(server, defaultActive = true) @@ -51,10 +54,6 @@ case class RedisCluster(redisServers: Seq[RedisServer], } } - val clusterSlotsRef:Ref[Option[Map[ClusterSlot, RedisConnection]]] = Ref(Option.empty[Map[ClusterSlot, RedisConnection]]) - val lockClusterSlots = Ref(true) - Await.result(asyncRefreshClusterSlots(force=true), Duration(10,TimeUnit.SECONDS)) - def getClusterSlots(): Future[Map[ClusterSlot, RedisConnection]] = { def resolveClusterSlots(retry:Int): Future[Map[ClusterSlot, RedisConnection]] = { @@ -183,6 +182,7 @@ case class RedisCluster(redisServers: Seq[RedisServer], }.values.toSeq } + Await.result(asyncRefreshClusterSlots(force=true), Duration(10,TimeUnit.SECONDS)) }