Only save settings once during node load process

This commit is contained in:
Nick O'Leary 2023-11-01 16:18:03 +01:00
parent 8d9b6dd859
commit 0117df0960
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -143,6 +143,12 @@ function loadModuleFiles(modules) {
return loadNodeSetList(pluginList); return loadNodeSetList(pluginList);
}).then(function() { }).then(function() {
return loadNodeSetList(nodeList); return loadNodeSetList(nodeList);
}).then(function () {
if (settings.available()) {
return registry.saveNodeList();
} else {
return
}
}) })
} }
@ -436,7 +442,7 @@ async function loadPlugin(plugin) {
return plugin; return plugin;
} }
} }
let invocation = 0
function loadNodeSetList(nodes) { function loadNodeSetList(nodes) {
var promises = []; var promises = [];
nodes.forEach(function(node) { nodes.forEach(function(node) {
@ -451,13 +457,7 @@ function loadNodeSetList(nodes) {
} }
}); });
return Promise.all(promises).then(function() { return Promise.all(promises)
if (settings.available()) {
return registry.saveNodeList();
} else {
return;
}
});
} }
function addModule(module) { function addModule(module) {