mirror of
https://github.com/node-red/node-red
synced 2024-11-21 23:48:30 +00:00
restart node only if node's group changes
This commit is contained in:
parent
1be337fbc5
commit
b66468c4ea
@ -148,8 +148,7 @@ function setFlows(_config,_credentials,type,muteLog,forceStart,user) {
|
||||
// Parse the configuration
|
||||
newFlowConfig = flowUtil.parseConfig(clone(config));
|
||||
// Generate a diff to identify what has changed
|
||||
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig,
|
||||
(type === "nodes"));
|
||||
diff = flowUtil.diffConfigs(activeFlowConfig,newFlowConfig);
|
||||
|
||||
// Now the flows have been compared, remove any credentials from newFlowConfig
|
||||
// so they don't cause false-positive diffs the next time a flow is deployed
|
||||
|
@ -438,15 +438,25 @@ module.exports = {
|
||||
if (newConfig.allNodes.hasOwnProperty(id)) {
|
||||
node = newConfig.allNodes[id];
|
||||
for (var prop in node) {
|
||||
if (ignoreGroup && (prop === "g")) {
|
||||
continue;
|
||||
}
|
||||
if (node.hasOwnProperty(prop) && prop != "z" && prop != "id" && prop != "wires") {
|
||||
// This node has a property that references a changed/removed node
|
||||
// Assume it is a config node change and mark this node as
|
||||
// changed.
|
||||
if (changed[node[prop]] || removed[node[prop]]) {
|
||||
|
||||
var changeOrigin = changed[node[prop]];
|
||||
if (changeOrigin || removed[node[prop]]) {
|
||||
if (!changed[node.id]) {
|
||||
if (changeOrigin &&
|
||||
(prop === "g") &&
|
||||
(changeOrigin.type === "group")) {
|
||||
var oldNode = oldConfig.allNodes[node.id];
|
||||
// ignore change of group node
|
||||
// if group of this node not changed
|
||||
if (oldNode &&
|
||||
(node.g === oldNode.g)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
madeChange = true;
|
||||
changed[node.id] = node;
|
||||
// This node exists within subflow template
|
||||
|
Loading…
Reference in New Issue
Block a user