Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for redis database parameter #12

Merged
merged 2 commits into from
May 20, 2012
Merged

Support for redis database parameter #12

merged 2 commits into from
May 20, 2012

Conversation

johnrengelman
Copy link
Contributor

This pull request adds support fo the redis database parameter that was added in Jedis 2.1. This allows an application to specify the grails.redis.database value which passes the value to the JedisPool bean. Updates made:

  1. Update to Jedis 2.1 which provides the database argument in the JedisPool constructor (gets passed to JedisFactory
  2. Modify the doWithSpring closure to get the database property from grails.redis.database or use the default as defined in the Protocol.DEFAULT_DATABASE
  3. Modify the declaration for redisPool to pass the database parameter value

Additionally, I found that when I tried to install redis:1.3 into a Grails 1.3.8 application, I would receive a compiler error. This is due to the annotation classes using a syntax that is only supported by Groovy 1.8 or higher, i.e. MemoizeList.groovy
@interface MemoizeList { Class value() default {true}: ...
The definition of value() is not support in Groovy 1.7.8.

…g and pass it to the JedisPool bean, update supported Grails to 2.x since the new annotations need Groovy 1.8

"redisPool${key}"(JedisPool, ref(poolBean), host, port, timeout, password) { bean ->
"redisPool${key}"(JedisPool, ref(poolBean), host, port, timeout, passwordi, database) { bean ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this yet, but I think that "i" that got stuck on the end of password is a typo. Can you fix that, test it and let me know if it works? Otherwise I don't have a problem with the changes you've made.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha. Yeah. Stupid vi. I'll fix that and update the pull request.

John

On May 17, 2012, at 7:43 PM, Ted Naleid
[email protected]
wrote:

  •    "redisPool${key}"(JedisPool, ref(poolBean), host, port, timeout, password) { bean ->
    
  •    "redisPool${key}"(JedisPool, ref(poolBean), host, port, timeout, passwordi, database) { bean ->
    

I haven't tested this yet, but I think that "i" that got stuck on the end of password is a typo. Can you fix that, test it and let me know if it works? Otherwise I don't have a problem with the changes you've made.


Reply to this email directly or view it on GitHub:
https://github.com/grails-plugins/grails-redis/pull/12/files#r843094

@johnrengelman
Copy link
Contributor Author

Fixed the typo. Ran the tests in the in the plugin and they passed.

tednaleid added a commit that referenced this pull request May 20, 2012
Support for redis database parameter
@tednaleid tednaleid merged commit d9ab91f into grails:master May 20, 2012
@tednaleid
Copy link
Contributor

Thanks for the pull request, I've merged it into master and plan on releasing a new version tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants