From c688e6b43b81910d25437fbb7047db049fbdba96 Mon Sep 17 00:00:00 2001 From: Killian McGuinness <5510428+Naillik1@users.noreply.github.com> Date: Thu, 24 Sep 2020 12:08:34 -0400 Subject: [PATCH] Use lazy redisConnection --- src/main/scala/redis/Redis.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/redis/Redis.scala b/src/main/scala/redis/Redis.scala index 69f8afdd..58b67166 100644 --- a/src/main/scala/redis/Redis.scala +++ b/src/main/scala/redis/Redis.scala @@ -34,7 +34,7 @@ abstract class RedisClientActorLike(system: ActorSystem, redisDispatcher: RedisD val db: Option[Int] = None implicit val executionContext = system.dispatchers.lookup(redisDispatcher.name) - val redisConnection: ActorRef = system.actorOf(RedisClientActor.props(new InetSocketAddress(host, port), + lazy val redisConnection: ActorRef = system.actorOf(RedisClientActor.props(new InetSocketAddress(host, port), getConnectOperations, onConnectStatus, redisDispatcher.name, connectTimeout) .withDispatcher(redisDispatcher.name), name + '-' + Redis.tempName()