in plugin/src/main/groovy/grails/plugins/redis/RedisService.groovy [228:246]
def memoizeScore(String key, String member, Map options = [:], Closure closure) {
def score = withOptionalRedis { Jedis redis ->
if (redis) redis.zscore(key, member)
}
if (!score) {
log.debug('cache miss: {}.{}', key, member)
score = closure()
if (score) withOptionalRedis { Jedis redis ->
if (redis) {
redis.zadd(key, score, member)
if (options?.expire && redis.ttl(key) == NO_EXPIRATION_TTL) redis.expire(key, options.expire)
}
}
} else {
log.debug('cache hit : {}.{} = {}', key, member, score)
}
score
}