Remove double parsing of JSON.

pull/5776/head
SamTV12345 2023-06-27 15:32:46 +02:00
parent fb6642c7e9
commit 3ab044f436
1 changed files with 2 additions and 9 deletions

View File

@ -79,16 +79,9 @@ exports.getAvailablePlugins = (maxCacheAge) => {
await axios.get('https://static.etherpad.org/plugins.json')
.then(pluginsLoaded => {
let plugins;
try {
plugins = JSON.parse(pluginsLoaded.data);
} catch (err) {
logger.error(`error parsing plugins.json: ${err.stack || err}`);
plugins = [];
}
exports.availablePlugins = plugins;
exports.availablePlugins = pluginsLoaded.data;
cacheTimestamp = nowTimestamp;
resolve(plugins);
resolve(exports.availablePlugins);
})
})
}