/admin/settings: Reload plugins, call `loadSettings` hook on restart

This should match the normal startup procedure a bit more closely.
pull/4782/head
Richard Hansen 2021-02-15 01:23:02 -05:00 committed by John McLear
parent 3ff244f7a0
commit ed93ef5636
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@
const eejs = require('../../eejs');
const fs = require('fs');
const hooks = require('../../../static/js/pluginfw/hooks');
const plugins = require('../../../static/js/pluginfw/plugins');
const settings = require('../../utils/Settings');
exports.expressCreateServer = (hookName, args, cb) => {
@ -47,6 +48,8 @@ exports.socketio = (hookName, args, cb) => {
socket.on('restartServer', async () => {
console.log('Admin request to restart server through a socket on /admin/settings');
settings.reloadSettings();
await plugins.update();
await hooks.aCallAll('loadSettings', {settings});
await hooks.aCallAll('restartServer');
});
});