catbox-redis
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -24,3 +24,3 @@ // After starting this example load http://localhost:8080 and hit refresh, you will notice that it loads the response from cache for the first 5 seconds and then reloads the cache | ||
else { | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.writeHead(200, { 'Content-Type': 'text/plain' }); | ||
res.end(item); | ||
@@ -50,8 +50,6 @@ } | ||
} | ||
else { | ||
internals.client.set(key, cacheValue, ttl, function (error) { | ||
internals.client.set(key, cacheValue, ttl, function (error) { | ||
callback(error, cacheValue); | ||
}); | ||
} | ||
callback(error, cacheValue); | ||
}); | ||
}); | ||
@@ -79,3 +77,3 @@ }; | ||
console.log(err); | ||
console.log('Could not connect to redis. Ending process.') | ||
console.log('Could not connect to redis. Ending process.'); | ||
process.exit(); | ||
@@ -82,0 +80,0 @@ } else { |
@@ -40,3 +40,3 @@ // Load modules | ||
} | ||
if (this.settings.database) { | ||
@@ -43,0 +43,0 @@ client.select(this.settings.database); |
{ | ||
"name": "catbox-redis", | ||
"description": "Redis adapter for catbox", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
@@ -10,3 +10,3 @@ "contributors": [ | ||
"repository": "git://github.com/hapijs/catbox-redis", | ||
"main": "index", | ||
"main": "lib/index.js", | ||
"keywords": [ | ||
@@ -21,3 +21,3 @@ "cache", | ||
"dependencies": { | ||
"redis": "0.12.x", | ||
"redis": "2.2.x", | ||
"hoek": "2.x.x" | ||
@@ -28,13 +28,9 @@ }, | ||
"code": "1.x.x", | ||
"lab": "5.x.x" | ||
"lab": "6.x.x" | ||
}, | ||
"scripts": { | ||
"test": "make test-cov" | ||
"test": "lab -r console -t 100 -a code -L", | ||
"test-cov-html": "lab -r html -o coverage.html -a code -L" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "BSD", | ||
"url": "http://github.com/hapijs/catbox-redis/raw/master/LICENSE" | ||
} | ||
] | ||
"license": "BSD-3-Clause" | ||
} |
@@ -28,3 +28,3 @@ // Load modules | ||
var redis = Redis(); | ||
Redis(); | ||
}; | ||
@@ -290,3 +290,3 @@ | ||
var client = new Catbox.Client(Redis); | ||
var cache = new Catbox.Policy(config, client, ''); | ||
new Catbox.Policy(config, client, ''); | ||
}; | ||
@@ -305,3 +305,3 @@ expect(fn).to.throw(Error); | ||
var client = new Catbox.Client(Redis); | ||
var cache = new Catbox.Policy(config, client, 'a\0b'); | ||
new Catbox.Policy(config, client, 'a\0b'); | ||
}; | ||
@@ -400,7 +400,9 @@ expect(fn).to.throw(Error); | ||
redis.start(function (err) { | ||
done(); | ||
}); | ||
}); | ||
it('sends select command when database is provided', function (done) { | ||
var options = { | ||
@@ -411,9 +413,10 @@ host: '127.0.0.1', | ||
}; | ||
var redis = new Redis(options); | ||
redis.start(function () {}); | ||
// redis.client.selected_db gets updated after the callback | ||
setTimeout(function () { | ||
expect(redis.client.selected_db).to.equal(1); | ||
@@ -447,4 +450,4 @@ done(); | ||
it ('returns true when when connected', function (done) { | ||
it('returns true when when connected', function (done) { | ||
var options = { | ||
@@ -468,3 +471,3 @@ host: '127.0.0.1', | ||
it ('returns false when stopped', function (done) { | ||
it('returns false when stopped', function (done) { | ||
@@ -491,3 +494,3 @@ var options = { | ||
it ('returns false when disconnected', function (done) { | ||
it('returns false when disconnected', function (done) { | ||
@@ -511,3 +514,2 @@ var options = { | ||
redis.stop(); | ||
done(); | ||
@@ -514,0 +516,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
30947
9
778
+ Addeddouble-ended-queue@2.1.0-0(transitive)
+ Addedredis@2.2.5(transitive)
- Removedredis@0.12.1(transitive)
Updatedredis@2.2.x