mirror of https://github.com/node-red/node-red.git
Merge pull request #4409 from node-red/4381-avoid-multiple-settings-saves
Only save settings once during node load processpull/4417/head^2
commit
6829535350
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue