diff --git a/lib/ExpressRedisCache/get.js b/lib/ExpressRedisCache/get.js index dac1ffa..99e1aff 100644 --- a/lib/ExpressRedisCache/get.js +++ b/lib/ExpressRedisCache/get.js @@ -55,13 +55,13 @@ module.exports = (function () { /** If has wildcard */ if ( hasWildcard ) { /** Get a list of keys using the wildcard */ - self.client.keys(prefix + ':' + name, domain.intercept(function (keys) { - if ( ! keys.length ) { + self.client.scan(0, 'match', prefix + ':' + name, domain.intercept(function (result) { + if ( typeof result[1] === 'undefined' ) { callback(null, []); return domain.exit(); } - require('async').parallel(keys.map(function (key) { + require('async').parallel(result[1].map(function (key) { return function (cb) { return fetchKey(key, cb); };