mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-18 02:20:49 +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:
@@ -2,7 +2,6 @@
|
||||
|
||||
var async = require('async');
|
||||
|
||||
var db = require('../../database');
|
||||
var groups = require('../../groups');
|
||||
var categories = require('../../categories');
|
||||
var privileges = require('../../privileges');
|
||||
@@ -21,7 +20,7 @@ Categories.create = function (socket, data, callback) {
|
||||
|
||||
Categories.getAll = function (socket, data, callback) {
|
||||
async.waterfall([
|
||||
async.apply(db.getSortedSetRange, 'categories:cid', 0, -1),
|
||||
async.apply(categories.getAllCidsFromSet, 'categories:cid'),
|
||||
async.apply(categories.getCategoriesData),
|
||||
function (categories, next) {
|
||||
// Hook changes, there is no req, and res
|
||||
|
||||
Reference in New Issue
Block a user