mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
cache categories:cid and cid:<cid>:children
these rarely change, no need to go to db for them
This commit is contained in:
@@ -7,6 +7,7 @@ var plugins = require('../plugins');
|
||||
var topics = require('../topics');
|
||||
var groups = require('../groups');
|
||||
var privileges = require('../privileges');
|
||||
var cache = require('../cache');
|
||||
|
||||
module.exports = function (Categories) {
|
||||
Categories.purge = function (cid, uid, callback) {
|
||||
@@ -94,7 +95,18 @@ module.exports = function (Categories) {
|
||||
], next);
|
||||
}, next);
|
||||
},
|
||||
], next);
|
||||
], function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
cache.del([
|
||||
'categories:cid',
|
||||
'cid:0:children',
|
||||
'cid:' + results.parentCid + ':children',
|
||||
'cid:' + cid + ':children',
|
||||
]);
|
||||
next();
|
||||
});
|
||||
},
|
||||
], function (err) {
|
||||
callback(err);
|
||||
|
||||
Reference in New Issue
Block a user