mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
Categories optimize (#6999)
* WIP * fix category page * fix counts, and copyPrivileges * fix lint * more fixes, * redis fix * fix test * fix category test * remove getParentsAndChildren
This commit is contained in:
committed by
GitHub
parent
96a2be9b55
commit
53ad2bbd6e
@@ -392,14 +392,14 @@ function giveGlobalPrivileges(next) {
|
||||
|
||||
function createCategories(next) {
|
||||
var Categories = require('./categories');
|
||||
|
||||
Categories.getAllCategories(0, function (err, categoryData) {
|
||||
var db = require('./database');
|
||||
db.getSortedSetRange('categories:cid', 0, -1, function (err, cids) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (Array.isArray(categoryData) && categoryData.length) {
|
||||
console.log('Categories OK. Found ' + categoryData.length + ' categories.');
|
||||
if (Array.isArray(cids) && cids.length) {
|
||||
console.log('Categories OK. Found ' + cids.length + ' categories.');
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user