barisusakli 10 years ago
parent 5337a31eb9
commit 6b20cf5cff

@ -150,8 +150,6 @@ function start() {
plugins = require('./src/plugins'),
upgrade = require('./src/upgrade');
meta.themes.setupPaths();
templates.setGlobal('relative_path', nconf.get('relative_path'));
upgrade.check(function(schema_ok) {
@ -159,12 +157,13 @@ function start() {
webserver.init();
sockets.init(webserver.server);
if (nconf.get('isPrimary')) {
if (nconf.get('isPrimary') === 'true') {
require('./src/notifications').init();
require('./src/user').startJobs();
}
async.waterfall([
async.apply(meta.themes.setupPaths),
async.apply(plugins.ready),
async.apply(meta.templates.compile),
async.apply(webserver.listen)

@ -108,7 +108,7 @@ module.exports = function(Meta) {
}
};
Meta.themes.setupPaths = function() {
Meta.themes.setupPaths = function(callback) {
async.parallel({
themesData: Meta.themes.get,
currentThemeId: function(next) {
@ -116,7 +116,7 @@ module.exports = function(Meta) {
}
}, function(err, data) {
if (err) {
return winston.error(err.stack);
return callback(err);
}
var themeId = data.currentThemeId || 'nodebb-theme-vanilla';
@ -125,12 +125,16 @@ module.exports = function(Meta) {
return themeObj.id === themeId;
})[0];
if (process.env.NODE_ENV === 'development') {
winston.info('[themes] Using theme ' + themeId);
}
if (!themeObj) {
return callback(new Error('[[error:theme-not-found]]'));
}
Meta.themes.setPath(themeObj);
callback();
});
};

Loading…
Cancel
Save