run plugins.reload after activating widget-essentials

v1.18.x
psychobunny 11 years ago
parent fffbb1db34
commit 251fef9c27

@ -19,7 +19,7 @@ var db = require('./database'),
Upgrade.check = function(callback) { Upgrade.check = function(callback) {
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema
var latestSchema = new Date(2014, 1, 20, 20, 20).getTime(); var latestSchema = new Date(2014, 1, 20, 20, 25).getTime();
db.get('schemaDate', function(err, value) { db.get('schemaDate', function(err, value) {
if (parseInt(value, 10) >= latestSchema) { if (parseInt(value, 10) >= latestSchema) {
@ -798,14 +798,16 @@ Upgrade.upgrade = function(callback) {
} }
}, },
function(next) { function(next) {
thisSchemaDate = new Date(2014, 1, 20, 20, 20).getTime(); thisSchemaDate = new Date(2014, 1, 20, 20, 25).getTime();
if (schemaDate < thisSchemaDate) { if (schemaDate < thisSchemaDate) {
updatesMade = true; updatesMade = true;
db.setAdd('plugins:active', 'nodebb-widget-essentials', function(err) { db.setAdd('plugins:active', 'nodebb-widget-essentials', function(err) {
winston.info('[2014/2/20] Activating NodeBB Essential Widgets'); winston.info('[2014/2/20] Activating NodeBB Essential Widgets');
next(err); Plugins.reload(function() {
next(err);
});
}); });
} else { } else {
winston.info('[2014/2/20] Activating NodeBB Essential Widgets - skipped'); winston.info('[2014/2/20] Activating NodeBB Essential Widgets - skipped');

Loading…
Cancel
Save