mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
optimizing template compilation
This commit is contained in:
@@ -71,9 +71,17 @@ function compileTemplates(pluginTemplates) {
|
|||||||
rimraf.sync(viewsPath);
|
rimraf.sync(viewsPath);
|
||||||
mkdirp.sync(viewsPath);
|
mkdirp.sync(viewsPath);
|
||||||
|
|
||||||
utils.walk(baseTemplatesPath, function(err, baseTpls) {
|
async.parallel({
|
||||||
utils.walk(themeTemplatesPath, function (err, themeTpls) {
|
baseTpls: function(next) {
|
||||||
var paths = {};
|
utils.walk(baseTemplatesPath, next);
|
||||||
|
},
|
||||||
|
themeTpls: function(next) {
|
||||||
|
utils.walk(themeTemplatesPath, next);
|
||||||
|
}
|
||||||
|
}, function(err, data) {
|
||||||
|
var baseTpls = data.baseTpls,
|
||||||
|
themeTpls = data.themeTpls,
|
||||||
|
paths = {};
|
||||||
|
|
||||||
if (!baseTpls || !themeTpls) {
|
if (!baseTpls || !themeTpls) {
|
||||||
winston.warn('[themes] Could not find base template files at: ' + baseTemplatesPath);
|
winston.warn('[themes] Could not find base template files at: ' + baseTemplatesPath);
|
||||||
@@ -123,7 +131,6 @@ function compileTemplates(pluginTemplates) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleErrors(err, req, res, next) {
|
function handleErrors(err, req, res, next) {
|
||||||
|
|||||||
Reference in New Issue
Block a user