removing reload, closes #4936, closes #4929

v1.18.x
Julian Lam 9 years ago
parent 474eea942f
commit bc961e2157

@ -19,8 +19,8 @@ dashboardController.get = function(req, res, next) {
var notices = [ var notices = [
{ {
done: !meta.reloadRequired, done: !meta.reloadRequired,
doneText: 'Reload not required', doneText: 'Restart not required',
notDoneText:'Reload required' notDoneText:'Restart required'
}, },
{ {
done: plugins.hasListeners('filter:search.query'), done: plugins.hasListeners('filter:search.query'),

@ -41,50 +41,14 @@ var async = require('async'),
}); });
}; };
/**
* Reload deprecated as of v1.1.2+, remove in v2.x
*/
Meta.reload = function(callback) { Meta.reload = function(callback) {
pubsub.publish('meta:reload', {hostname: os.hostname()}); restart();
reload(callback); callback();
}; };
pubsub.on('meta:reload', function(data) {
if (data.hostname !== os.hostname()) {
reload();
}
});
function reload(callback) {
callback = callback || function() {};
var plugins = require('./plugins');
async.series([
function (next) {
plugins.fireHook('static:app.reload', {}, next);
},
async.apply(plugins.clearRequireCache),
async.apply(Meta.css.minify),
async.apply(Meta.js.minify, 'nodebb.min.js'),
async.apply(Meta.js.minify, 'acp.min.js'),
async.apply(Meta.sounds.init),
async.apply(languages.init),
async.apply(Meta.templates.compile),
async.apply(plugins.reload),
async.apply(plugins.reloadRoutes),
async.apply(auth.reloadRoutes),
function(next) {
Meta.config['cache-buster'] = utils.generateUUID();
templates.flush();
next();
}
], function(err) {
if (!err) {
emitter.emit('nodebb:ready');
}
Meta.reloadRequired = false;
callback(err);
});
}
Meta.restart = function() { Meta.restart = function() {
pubsub.publish('meta:restart', {hostname: os.hostname()}); pubsub.publish('meta:restart', {hostname: os.hostname()});
restart(); restart();

@ -161,6 +161,4 @@ module.exports = function(Meta) {
nconf.set('theme_templates_path', themePath); nconf.set('theme_templates_path', themePath);
nconf.set('theme_config', path.join(nconf.get('themes_path'), themeObj.id, 'theme.json')); nconf.set('theme_config', path.join(nconf.get('themes_path'), themeObj.id, 'theme.json'));
}; };
}; };

@ -49,21 +49,10 @@ SocketAdmin.before = function(socket, method, data, next) {
}); });
}; };
SocketAdmin.reload = function(socket, data, callback) { /**
events.log({ * Reload deprecated as of v1.1.2+, remove in v2.x
type: 'reload', */
uid: socket.uid, SocketAdmin.reload = SocketAdmin.restart;
ip: socket.ip
});
if (process.send) {
process.send({
action: 'reload'
});
callback();
} else {
meta.reload(callback);
}
};
SocketAdmin.restart = function(socket, data, callback) { SocketAdmin.restart = function(socket, data, callback) {
events.log({ events.log({

@ -95,11 +95,10 @@
<div class="panel-heading">System Control</div> <div class="panel-heading">System Control</div>
<div class="panel-body text-center"> <div class="panel-body text-center">
<p> <p>
<button class="btn btn-warning reload" data-placement="bottom" data-toggle="tooltip" title="Reload NodeBB to activate new plugins">Reload</button> <button class="btn btn-danger btn-block restart" data-placement="bottom" data-toggle="tooltip" title="Restarting NodeBB will drop all existing connections for a few seconds">Restart</button>
<button class="btn btn-danger restart" data-placement="bottom" data-toggle="tooltip" title="Restarting NodeBB will drop all existing connections for a few seconds">Restart</button>
</p> </p>
<p> <p>
<a href="{config.relative_path}/admin/settings/advanced" class="btn btn-info" data-placement="bottom" data-toggle="tooltip" title="Click here to set up maintenance mode for NodeBB">Maintenance Mode</a> <a href="{config.relative_path}/admin/settings/advanced" class="btn btn-info btn-block" data-placement="bottom" data-toggle="tooltip" title="Click here to set up maintenance mode for NodeBB">Maintenance Mode</a>
</p> </p>
<hr /> <hr />

@ -121,11 +121,6 @@
<i class="fa fa-fw fa-ellipsis-v"></i> <i class="fa fa-fw fa-ellipsis-v"></i>
</a> </a>
<ul id="user-control-list" class="dropdown-menu" aria-labelledby="user_dropdown"> <ul id="user-control-list" class="dropdown-menu" aria-labelledby="user_dropdown">
<li>
<a href="#" class="reload" title="Reload Forum">
Reload Forum
</a>
</li>
<li> <li>
<a href="#" class="restart" title="Restart Forum"> <a href="#" class="restart" title="Restart Forum">
Restart Forum Restart Forum

@ -88,7 +88,7 @@
<input class="form-control" id="eventLoopLagThreshold" type="number" data-field="eventLoopLagThreshold" placeholder="Default: 70" step="10" min="10" value="70" /> <input class="form-control" id="eventLoopLagThreshold" type="number" data-field="eventLoopLagThreshold" placeholder="Default: 70" step="10" min="10" value="70" />
<p class="help-block"> <p class="help-block">
Lowering this value decreases wait times for page loads, but will also show the Lowering this value decreases wait times for page loads, but will also show the
"excessive load" message to more users. (Reload required) "excessive load" message to more users. (Restart required)
</p> </p>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -96,7 +96,7 @@
<input class="form-control" id="eventLoopInterval" type="number" data-field="eventLoopInterval" placeholder="Default: 500" value="500" step="50" /> <input class="form-control" id="eventLoopInterval" type="number" data-field="eventLoopInterval" placeholder="Default: 500" value="500" step="50" />
<p class="help-block"> <p class="help-block">
Lowering this value causes NodeBB to become more sensitive to spikes in load, but Lowering this value causes NodeBB to become more sensitive to spikes in load, but
may also cause the check to become too sensitive. (Reload required) may also cause the check to become too sensitive. (Restart required)
</p> </p>
</div> </div>
</form> </form>

Loading…
Cancel
Save