Node.js based forum software built for the modern web
removing reload, closes #4936, closes #4929
Julian Lambc961e21575b
diff --git a/src/controllers/admin/dashboard.js b/src/controllers/admin/dashboard.jsindex 24a65983f1..84ee4fd3d0 100644--- a/src/controllers/admin/dashboard.js+++ b/src/controllers/admin/dashboard.js@@ -19,8 +19,8 @@ dashboardController.get = function(req, res, next) {var notices = [{done: !meta.reloadRequired,- doneText: 'Reload not required',- notDoneText:'Reload required'+ doneText: 'Restart not required',+ notDoneText:'Restart required'},{done: plugins.hasListeners('filter:search.query'),diff --git a/src/meta.js b/src/meta.jsindex 1cbd1af0ae..8dfbc0d99a 100644--- a/src/meta.js+++ b/src/meta.js@@ -41,50 +41,14 @@ var async = require('async'),});};+ /**+ * Reload deprecated as of v1.1.2+, remove in v2.x+ */Meta.reload = function(callback) {- pubsub.publish('meta:reload', {hostname: os.hostname()});- reload(callback);+ restart();+ 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() {pubsub.publish('meta:restart', {hostname: os.hostname()});restart();diff --git a/src/meta/themes.js b/src/meta/themes.jsindex c3d912a222..ed6b061db9 100644--- a/src/meta/themes.js+++ b/src/meta/themes.js@@ -161,6 +161,4 @@ module.exports = function(Meta) {nconf.set('theme_templates_path', themePath);nconf.set('theme_config', path.join(nconf.get('themes_path'), themeObj.id, 'theme.json'));};--};\ No newline at end of filediff --git a/src/socket.io/admin.js b/src/socket.io/admin.jsindex a290238e21..556eee0290 100644--- a/src/socket.io/admin.js+++ b/src/socket.io/admin.js@@ -49,21 +49,10 @@ SocketAdmin.before = function(socket, method, data, next) {});};-SocketAdmin.reload = function(socket, data, callback) {- events.log({- type: 'reload',- uid: socket.uid,- ip: socket.ip- });- if (process.send) {- process.send({- action: 'reload'- });- callback();- } else {- meta.reload(callback);- }-};+/**+ * Reload deprecated as of v1.1.2+, remove in v2.x+ */+SocketAdmin.reload = SocketAdmin.restart;SocketAdmin.restart = function(socket, data, callback) {events.log({diff --git a/src/views/admin/general/dashboard.tpl b/src/views/admin/general/dashboard.tplindex 6ea841352a..a478c21c16 100644--- a/src/views/admin/general/dashboard.tpl+++ b/src/views/admin/general/dashboard.tpl@@ -95,11 +95,10 @@<div class="panel-heading">System Control</div><div class="panel-body text-center"><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 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 btn-block restart" data-placement="bottom" data-toggle="tooltip" title="Restarting NodeBB will drop all existing connections for a few seconds">Restart</button></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><hr />diff --git a/src/views/admin/partials/menu.tpl b/src/views/admin/partials/menu.tplindex e35b41847c..34ddbf9acd 100644--- a/src/views/admin/partials/menu.tpl+++ b/src/views/admin/partials/menu.tpl@@ -121,11 +121,6 @@<i class="fa fa-fw fa-ellipsis-v"></i></a><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><a href="#" class="restart" title="Restart Forum">Restart Forumdiff --git a/src/views/admin/settings/advanced.tpl b/src/views/admin/settings/advanced.tplindex 3fd617cf83..f845d06a1c 100644--- a/src/views/admin/settings/advanced.tpl+++ b/src/views/admin/settings/advanced.tpl@@ -88,7 +88,7 @@<input class="form-control" id="eventLoopLagThreshold" type="number" data-field="eventLoopLagThreshold" placeholder="Default: 70" step="10" min="10" value="70" /><p class="help-block">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></div><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" /><p class="help-block">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></div></form>