1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Use flowChanged in diff to mark flows to restart

This commit is contained in:
Nick O'Leary 2023-07-10 12:30:36 +01:00
parent 7481b78b16
commit a5066d529f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 7 additions and 4 deletions

View File

@ -436,7 +436,8 @@ function stop(type,diff,muteLog,isDeploy) {
changed:[],
removed:[],
rewired:[],
linked:[]
linked:[],
flowChanged:[]
};
if (!muteLog) {
if (type !== "full") {
@ -471,7 +472,7 @@ function stop(type,diff,muteLog,isDeploy) {
activeFlowIds.forEach(id => {
if (activeFlows.hasOwnProperty(id)) {
var flowStateChanged = diff && (diff.changed.indexOf(id) !== -1 || diff.added.indexOf(id) !== -1 || diff.removed.indexOf(id) !== -1);
var flowStateChanged = diff && (diff.flowChanged.indexOf(id) !== -1 || diff.added.indexOf(id) !== -1 || diff.removed.indexOf(id) !== -1);
log.debug("red/nodes/flows.stop : stopping flow : "+id);
promises.push(activeFlows[id].stop(flowStateChanged?null:stopList,removedList));
if (type === "full" || flowStateChanged || diff.removed.indexOf(id)!==-1) {

View File

@ -356,6 +356,7 @@ function diffConfigs(oldConfig, newConfig) {
var added = {};
var removed = {};
var changed = {};
var flowChanged = {};
var wiringChanged = {};
var globalConfigChanged = false;
var linkMap = {};
@ -454,9 +455,9 @@ function diffConfigs(oldConfig, newConfig) {
}
}
}
} else {
} else if (!removed[id]) {
if (JSON.stringify(node.env) !== JSON.stringify(newConfig.allNodes[id].env)) {
changed[id] = newConfig.allNodes[id];
flowChanged[id] = newConfig.allNodes[id];
}
}
}
@ -625,6 +626,7 @@ function diffConfigs(oldConfig, newConfig) {
removed:Object.keys(removed),
rewired:Object.keys(wiringChanged),
linked:[],
flowChanged: Object.keys(flowChanged),
globalConfigChanged
}