@@ -40,7 +40,7 @@ redisCache.store.events.on('redisError', function(error) {
4040 console .log (error);
4141});
4242
43- redisCache .set (' foo' , ' bar' , ttl, function (err ) {
43+ redisCache .set (' foo' , ' bar' , { ttl: ttl } , function (err ) {
4444 if (err) {
4545 throw err;
4646 }
@@ -65,7 +65,7 @@ var key = 'user_' + userId;
6565// Note: ttl is optional in wrap()
6666redisCache .wrap (key, function (cb ) {
6767 getUser (userId, cb);
68- }, ttl, function (err , user ) {
68+ }, { ttl: ttl } , function (err , user ) {
6969 console .log (user);
7070
7171 // Second time fetches user from redisCache
@@ -94,7 +94,7 @@ key2 = 'user_' + userId;
9494ttl = 5 ;
9595
9696// Sets in all caches.
97- multiCache .set (' foo2' , ' bar2' , ttl, function (err ) {
97+ multiCache .set (' foo2' , ' bar2' , { ttl: ttl } , function (err ) {
9898 if (err) { throw err; }
9999
100100 // Fetches from highest priority cache that has the key.
@@ -110,7 +110,7 @@ multiCache.set('foo2', 'bar2', ttl, function(err) {
110110// Note: ttl is optional in wrap()
111111multiCache .wrap (key2, function (cb ) {
112112 getUser (userId2, cb);
113- }, ttl, function (err , user ) {
113+ }, { ttl: ttl } , function (err , user ) {
114114 console .log (user);
115115
116116 // Second time fetches user from memoryCache, since it's highest priority.
@@ -152,7 +152,7 @@ var redisCache = cacheManager.caching({
152152 compress: true
153153});
154154
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 )
156156redisCache .set (' foo' , ' bar' , { compress: false }, function (err ) {
157157 if (err) {
158158 throw err;
0 commit comments