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:
parent
7481b78b16
commit
a5066d529f
@ -436,7 +436,8 @@ function stop(type,diff,muteLog,isDeploy) {
|
|||||||
changed:[],
|
changed:[],
|
||||||
removed:[],
|
removed:[],
|
||||||
rewired:[],
|
rewired:[],
|
||||||
linked:[]
|
linked:[],
|
||||||
|
flowChanged:[]
|
||||||
};
|
};
|
||||||
if (!muteLog) {
|
if (!muteLog) {
|
||||||
if (type !== "full") {
|
if (type !== "full") {
|
||||||
@ -471,7 +472,7 @@ function stop(type,diff,muteLog,isDeploy) {
|
|||||||
|
|
||||||
activeFlowIds.forEach(id => {
|
activeFlowIds.forEach(id => {
|
||||||
if (activeFlows.hasOwnProperty(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);
|
log.debug("red/nodes/flows.stop : stopping flow : "+id);
|
||||||
promises.push(activeFlows[id].stop(flowStateChanged?null:stopList,removedList));
|
promises.push(activeFlows[id].stop(flowStateChanged?null:stopList,removedList));
|
||||||
if (type === "full" || flowStateChanged || diff.removed.indexOf(id)!==-1) {
|
if (type === "full" || flowStateChanged || diff.removed.indexOf(id)!==-1) {
|
||||||
|
@ -356,6 +356,7 @@ function diffConfigs(oldConfig, newConfig) {
|
|||||||
var added = {};
|
var added = {};
|
||||||
var removed = {};
|
var removed = {};
|
||||||
var changed = {};
|
var changed = {};
|
||||||
|
var flowChanged = {};
|
||||||
var wiringChanged = {};
|
var wiringChanged = {};
|
||||||
var globalConfigChanged = false;
|
var globalConfigChanged = false;
|
||||||
var linkMap = {};
|
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)) {
|
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),
|
removed:Object.keys(removed),
|
||||||
rewired:Object.keys(wiringChanged),
|
rewired:Object.keys(wiringChanged),
|
||||||
linked:[],
|
linked:[],
|
||||||
|
flowChanged: Object.keys(flowChanged),
|
||||||
globalConfigChanged
|
globalConfigChanged
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user