play-plugins icon indicating copy to clipboard operation
play-plugins copied to clipboard

support configuration of redis host/port user/pass via a single URI property

Open sclasen opened this issue 12 years ago • 0 comments

would make using this on heroku easier, since they give you a redis url. so application conf could look like

redis.url=${REDISTOGO_URL}

and used like...

val redisUrl = new URI(current.config.getString("redis.url").get) val redisPassword: Option[String] = Option(redisUrl.getUserInfo).map(_.split(":").apply(1))

lazy val redisPool = createRedisPool()

def redisConnection(): Jedis = { val redis = new Jedis(redisUrl.getHost, redisUrl.getPort) for (p <- redisPassword) { redis.auth(p) } log.info("redisConnection()") redis }

sclasen avatar Jul 02 '12 17:07 sclasen