@@ -40,7 +40,7 @@ redisCache.store.events.on('redisError', function(error) {
40
40
console .log (error);
41
41
});
42
42
43
- redisCache .set (' foo' , ' bar' , ttl, function (err ) {
43
+ redisCache .set (' foo' , ' bar' , { ttl: ttl } , function (err ) {
44
44
if (err) {
45
45
throw err;
46
46
}
@@ -65,7 +65,7 @@ var key = 'user_' + userId;
65
65
// Note: ttl is optional in wrap()
66
66
redisCache .wrap (key, function (cb ) {
67
67
getUser (userId, cb);
68
- }, ttl, function (err , user ) {
68
+ }, { ttl: ttl } , function (err , user ) {
69
69
console .log (user);
70
70
71
71
// Second time fetches user from redisCache
@@ -94,7 +94,7 @@ key2 = 'user_' + userId;
94
94
ttl = 5 ;
95
95
96
96
// Sets in all caches.
97
- multiCache .set (' foo2' , ' bar2' , ttl, function (err ) {
97
+ multiCache .set (' foo2' , ' bar2' , { ttl: ttl } , function (err ) {
98
98
if (err) { throw err; }
99
99
100
100
// Fetches from highest priority cache that has the key.
@@ -110,7 +110,7 @@ multiCache.set('foo2', 'bar2', ttl, function(err) {
110
110
// Note: ttl is optional in wrap()
111
111
multiCache .wrap (key2, function (cb ) {
112
112
getUser (userId2, cb);
113
- }, ttl, function (err , user ) {
113
+ }, { ttl: ttl } , function (err , user ) {
114
114
console .log (user);
115
115
116
116
// Second time fetches user from memoryCache, since it's highest priority.
@@ -152,7 +152,7 @@ var redisCache = cacheManager.caching({
152
152
compress: true
153
153
});
154
154
155
- // Or on a per command basis. (only applies to get / set commands )
155
+ // Or on a per command basis. (only applies to get / set / wrap )
156
156
redisCache .set (' foo' , ' bar' , { compress: false }, function (err ) {
157
157
if (err) {
158
158
throw err;
0 commit comments