mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-03 14:20:33 +01:00
add cache to redis (#6917)
* add cache to redis move out cache module from mongo * fix redis tests * add callback noop * fix typo * del cache on field delete * make redis/mongo caches separate
This commit is contained in:
committed by
GitHub
parent
f8b1df4e3a
commit
75816deca7
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
var async = require('async');
|
||||
var async = require('async');
|
||||
var assert = require('assert');
|
||||
var db = require('../mocks/databasemock');
|
||||
|
||||
|
||||
@@ -172,6 +172,24 @@ describe('Key methods', function () {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the correct value', function (done) {
|
||||
db.increment('testingCache', function (err) {
|
||||
assert.ifError(err);
|
||||
db.get('testingCache', function (err, value) {
|
||||
assert.ifError(err);
|
||||
assert.equal(value, 1);
|
||||
db.increment('testingCache', function (err) {
|
||||
assert.ifError(err);
|
||||
db.get('testingCache', function (err, value) {
|
||||
assert.ifError(err);
|
||||
assert.equal(value, 2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('rename', function () {
|
||||
|
||||
Reference in New Issue
Block a user