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

Ensure flows wait for all nodes to close before restarting

Fixes #2067
This commit is contained in:
Nick O'Leary 2019-02-27 20:56:58 +00:00
parent fec52a8151
commit f4f664a4a2
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -388,14 +388,14 @@ function stop(type,diff,muteLog) {
if (activeFlows.hasOwnProperty(id)) {
var flowStateChanged = diff && (diff.added.indexOf(id) !== -1 || diff.removed.indexOf(id) !== -1);
log.debug("red/nodes/flows.stop : stopping flow : "+id);
promises = promises.concat(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) {
delete activeFlows[id];
}
}
}
return Promise.resolve(promises).then(function() {
return Promise.all(promises).then(function() {
for (id in activeNodesToFlow) {
if (activeNodesToFlow.hasOwnProperty(id)) {
if (!activeFlows[activeNodesToFlow[id]]) {