grails-plugins/grails-redis — Issue #5: expire parameter in @Memoize* methods should parseLong, not parseInt
Author: ajbrown
Created: 2012-02-29 19:40:32+00:00
State: open

It appears that the expire parameter is expected to be an Integer. Since the expire time is in milliseconds, it should be expected to be a Long in order to support bigger expire times.

This breaks (expire in 60 days):
@Memoize( key="autocomplete:#{query}", expire='5184000000' )

with a NumberFormatException

This works fine
@Memoize( key="autocomplete:#{query}", expire='5184000' )

It looks like the problem is in line 62 of MemoizeASTTransformation.groovy:
argumentListExpression.addExpression(makeConstantExpression(Integer.parseInt(memoizeProperties.get(EXPIRE).toString())))

I will attempt a fix and open a pull request.