Skip to content

Commit 2e7b161

Browse files
author
Joseph Lokahi Podwys
committed
API and documentation upgrades.
1 parent 9d4f820 commit 2e7b161

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,9 @@ Delete a key or an array of keys and their associated values.
134134
* err: type: object
135135
* count: type: int
136136

137-
## .flushAll([cb])
137+
## .flush([cb])
138138

139-
> When used with `cache-service`, use `cacheService.flush()`.
140-
141-
Flush all keys and values from an instance of cache-service.
139+
Flush all keys and values.
142140

143141
* callback: type: function
144142

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cache-service-redis",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A redis plugin for cache-service.",
55
"main": "redisCacheModule.js",
66
"dependencies": {

redisCacheModule.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var redis = require('redis');
44
* redisCacheModule constructor
55
* @constructor
66
* @param config: {
7-
* type: {string | 'redis-standalone'}
7+
* type: {string | 'redis'}
88
* verbose: {boolean | false},
99
* expiration: {integer | 900},
1010
* readOnly: {boolean | false},
@@ -154,7 +154,7 @@ function redisCacheModule(config){
154154
* Flush all keys and values from all configured caches in cacheCollection
155155
* @param {function} cb
156156
*/
157-
self.flushAll = function(cb){
157+
self.flush = function(cb){
158158
log(false, 'Attempting to flush all data.');
159159
try {
160160
self.db.flushall();

test/server/redis-cache-module.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var key = 'key';
77
var value = 'value';
88

99
beforeEach(function(){
10-
redisCache.flushAll();
10+
redisCache.flush();
1111
});
1212

1313
describe('redisCacheModule Tests', function () {
@@ -32,14 +32,14 @@ describe('redisCacheModule Tests', function () {
3232
done();
3333
});
3434
});
35-
it('Setting several keys then calling .flushAll() should remove all keys', function (done) {
35+
it('Setting several keys then calling .flush() should remove all keys', function (done) {
3636
redisCache.set(key, value);
3737
redisCache.set('key2', 'value2');
3838
redisCache.set('key3', 'value3');
3939
redisCache.db.keys('*', function (err, keys){
4040
var keyCount = keys.length;
4141
expect(keyCount).toBe(3);
42-
redisCache.flushAll();
42+
redisCache.flush();
4343
redisCache.db.keys('*', function (err, keys){
4444
keyCount = keys.length;
4545
expect(keyCount).toBe(0);

0 commit comments

Comments
 (0)