Browse Source

updating redis example to use latest redis npm

feature/specify-what-to-cache
Bryan Donovan 10 years ago
parent
commit
2e33acda47
  1. 2
      examples/redis_example/example.js
  2. 9
      examples/redis_example/redis_store.js

2
examples/redis_example/example.js

@ -1,5 +1,5 @@
// Setup:
// npm install redis@0.6.7 sol-redis-pool@0.1.0
// npm install redis@0.12.1 sol-redis-pool@0.2.0
// node examples/redis_example/example.js
var util = require('util');

9
examples/redis_example/redis_store.js

@ -10,16 +10,13 @@ function redisStore(args) {
var self = {};
var ttlDefault = args.ttl;
self.name = 'redis';
self.client = require('redis').createClient(args.port, args.host, args);
//jscs:disable requireCamelCaseOrUpperCaseIdentifiers
var redisOptions = {
redis_host: args.host || '127.0.0.1',
redis_port: args.port || 6379
host: args.host || '127.0.0.1',
port: args.port || 6379
};
//jscs:enable requireCamelCaseOrUpperCaseIdentifiers
var pool = new RedisPool(redisOptions);
var pool = new RedisPool(redisOptions, {});
function connect(cb) {
pool.acquire(function(err, conn) {

Loading…
Cancel
Save