fix for caching plugin-definitions

This commit is contained in:
webzwo0i 2021-02-15 08:52:38 +01:00 committed by John McLear
parent bdb78adb3f
commit 0bb3e65020
5 changed files with 32 additions and 20 deletions

View file

@ -12,9 +12,10 @@ exports.update = (cb) => {
// of execution on Firefox. This schedules the response in the run-loop,
// which appears to fix the issue.
const callback = () => setTimeout(cb, 0);
$.ajaxSetup({cache: false});
jQuery.getJSON(`${exports.baseURL}pluginfw/plugin-definitions.json`).done((data) => {
jQuery.getJSON(
`${exports.baseURL}pluginfw/plugin-definitions.json?v=${clientVars.randomVersionString}`
).done((data) => {
defs.plugins = data.plugins;
defs.parts = data.parts;
defs.hooks = pluginUtils.extractHooks(defs.parts, 'client_hooks');

View file

@ -5,11 +5,14 @@ const plugins = require('./plugins');
const hooks = require('./hooks');
const request = require('request');
const runCmd = require('../../../node/utils/run_cmd');
const settings = require('../../../node/utils/Settings');
const logger = log4js.getLogger('plugins');
const onAllTasksFinished = () => {
hooks.aCallAll('restartServer', {}, () => {});
const onAllTasksFinished = async () => {
settings.reloadSettings();
await hooks.aCallAll('loadSettings', {settings});
await hooks.aCallAll('restartServer');
};
let tasks = 0;