mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
Remove double parsing of JSON.
This commit is contained in:
parent
fb6642c7e9
commit
3ab044f436
1 changed files with 2 additions and 9 deletions
|
@ -79,16 +79,9 @@ exports.getAvailablePlugins = (maxCacheAge) => {
|
||||||
|
|
||||||
await axios.get('https://static.etherpad.org/plugins.json')
|
await axios.get('https://static.etherpad.org/plugins.json')
|
||||||
.then(pluginsLoaded => {
|
.then(pluginsLoaded => {
|
||||||
let plugins;
|
exports.availablePlugins = pluginsLoaded.data;
|
||||||
try {
|
|
||||||
plugins = JSON.parse(pluginsLoaded.data);
|
|
||||||
} catch (err) {
|
|
||||||
logger.error(`error parsing plugins.json: ${err.stack || err}`);
|
|
||||||
plugins = [];
|
|
||||||
}
|
|
||||||
exports.availablePlugins = plugins;
|
|
||||||
cacheTimestamp = nowTimestamp;
|
cacheTimestamp = nowTimestamp;
|
||||||
resolve(plugins);
|
resolve(exports.availablePlugins);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue