Skip to content

Commit

Permalink
Allow sentinels to be defined in external properties config
Browse files Browse the repository at this point in the history
  • Loading branch information
christian.oestreich committed Jun 25, 2015
1 parent 1782ab4 commit 5719a48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -608,6 +608,7 @@ Release Notes
* 1.6.2 - released 02/06/2015 - Port and timeout properties injected by external properties file are now converted to Integer. If not integer, then defaults used.
* 2.0.0 - released 03/18/2015 - Grails 3.0.0 Support! You can install [from bintray](https://bintray.com/tednaleid/grails-plugins/org.grails.plugins%3Agrails-redis/2.0.0/view). There is a known issue where `@Memoize` annotations don't work on domain classes, most everything else works.
* 2.0.1 - released 05/04/2015 - web-inf directory removed from plugin
* 2.0.2 - released 06/25/2015 - Adding support for external configuration of sentinels

[redisgorm]: http://grails.github.com/inconsequential/redis/
[redis]: http://redis.io
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -30,7 +30,7 @@ ext {
gradleWrapperVersion = project.gradleWrapperVersion
}

version "2.0.1"
version "2.0.2"
group "org.grails.plugins"
sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand Down
Expand Up @@ -56,8 +56,16 @@ class RedisConfigurationUtil {

// If sentinels and a masterName is present, using different pool implementation
if (sentinels && masterName) {
"redisPool${key}"(JedisSentinelPool, masterName, sentinels as Set, ref(poolBean), timeout, password, database) { bean ->
bean.destroyMethod = 'destroy'
if (sentinels instanceof String) {
sentinels = Eval.me(sentinels.toString())
}

if (sentinels instanceof Collection) {
"redisPool${key}"(JedisSentinelPool, masterName, sentinels as Set, ref(poolBean), timeout, password, database) { bean ->
bean.destroyMethod = 'destroy'
}
} else {
throw new RuntimeException('Redis configuraiton property [sentinels] does not appear to be a valid collection.')
}
} else {
"redisPool${key}"(JedisPool, ref(poolBean), host, port, timeout, password, database) { bean ->
Expand Down

0 comments on commit 5719a48

Please sign in to comment.