Skip to content

Commit

Permalink
Resolved forward reference in RedisCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
KarelCemus authored and etaty committed Jul 7, 2019
1 parent c700141 commit aac07d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/redis/RedisCluster.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]] = {
Expand Down Expand Up @@ -183,6 +182,7 @@ case class RedisCluster(redisServers: Seq[RedisServer],
}.values.toSeq
}

Await.result(asyncRefreshClusterSlots(force=true), Duration(10,TimeUnit.SECONDS))
}


Expand Down

0 comments on commit aac07d2

Please sign in to comment.