mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 10:16:12 +01:00
limit number of js files minified, dont crash upgrade script of widget-settings is not found
This commit is contained in:
@@ -5,6 +5,7 @@ var path = require('path');
|
||||
var async = require('async');
|
||||
var nconf = require('nconf');
|
||||
var benchpress = require('benchpressjs');
|
||||
var winston = require('winston');
|
||||
|
||||
var plugins = require('../plugins');
|
||||
var groups = require('../groups');
|
||||
@@ -85,7 +86,7 @@ function renderAdminTemplate(callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
source: async.apply(fs.readFile, path.resolve(nconf.get('views_dir'), 'admin/partials/widget-settings.tpl'), 'utf8'),
|
||||
source: async.apply(getSource),
|
||||
groups: async.apply(groups.getNonPrivilegeGroups, 'groups:createtime', 0, -1),
|
||||
}, next);
|
||||
},
|
||||
@@ -95,3 +96,12 @@ function renderAdminTemplate(callback) {
|
||||
},
|
||||
], callback);
|
||||
}
|
||||
|
||||
function getSource(callback) {
|
||||
fs.readFile(path.resolve(nconf.get('views_dir'), 'admin/partials/widget-settings.tpl'), 'utf8', function (err, source) {
|
||||
if (err) {
|
||||
winston.error(err);
|
||||
}
|
||||
callback(null, source || '');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user