Merge pull request #4409 from node-red/4381-avoid-multiple-settings-saves

Only save settings once during node load process
This commit is contained in:
Nick O'Leary 2023-11-07 17:40:03 +00:00 committed by GitHub
commit 6829535350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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