mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
limit number of js files minified, dont crash upgrade script of widget-settings is not found
This commit is contained in:
@@ -168,7 +168,7 @@ function concat(data, callback) {
|
|||||||
actions.concat = concat;
|
actions.concat = concat;
|
||||||
|
|
||||||
function minifyJS_batch(data, callback) {
|
function minifyJS_batch(data, callback) {
|
||||||
async.each(data.files, function (fileObj, next) {
|
async.eachLimit(data.files, 100, function (fileObj, next) {
|
||||||
fs.readFile(fileObj.srcPath, 'utf8', function (err, source) {
|
fs.readFile(fileObj.srcPath, 'utf8', function (err, source) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ var path = require('path');
|
|||||||
var async = require('async');
|
var async = require('async');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
var benchpress = require('benchpressjs');
|
var benchpress = require('benchpressjs');
|
||||||
|
var winston = require('winston');
|
||||||
|
|
||||||
var plugins = require('../plugins');
|
var plugins = require('../plugins');
|
||||||
var groups = require('../groups');
|
var groups = require('../groups');
|
||||||
@@ -85,7 +86,7 @@ function renderAdminTemplate(callback) {
|
|||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
async.parallel({
|
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),
|
groups: async.apply(groups.getNonPrivilegeGroups, 'groups:createtime', 0, -1),
|
||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
@@ -95,3 +96,12 @@ function renderAdminTemplate(callback) {
|
|||||||
},
|
},
|
||||||
], 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