mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Ensure all subflow instances are stopped when flow stopping
Fixes #2095
This commit is contained in:
parent
6fe2b24592
commit
afa69f4c0e
@ -247,6 +247,7 @@ class Flow {
|
|||||||
if (!stopList) {
|
if (!stopList) {
|
||||||
stopList = Object.keys(this.activeNodes);
|
stopList = Object.keys(this.activeNodes);
|
||||||
}
|
}
|
||||||
|
// this.trace(" stopList: "+stopList.join(","))
|
||||||
// Convert the list to a map to avoid multiple scans of the list
|
// Convert the list to a map to avoid multiple scans of the list
|
||||||
var removedMap = {};
|
var removedMap = {};
|
||||||
removedList = removedList || [];
|
removedList = removedList || [];
|
||||||
@ -261,8 +262,9 @@ class Flow {
|
|||||||
delete this.activeNodes[stopList[i]];
|
delete this.activeNodes[stopList[i]];
|
||||||
if (this.subflowInstanceNodes[stopList[i]]) {
|
if (this.subflowInstanceNodes[stopList[i]]) {
|
||||||
try {
|
try {
|
||||||
var subflow = this.subflowInstanceNodes[stopList[i]];
|
(function(subflow) {
|
||||||
promises.push(stopNode(node,false).then(() => { subflow.stop() }));
|
promises.push(stopNode(node,false).then(() => { subflow.stop() }));
|
||||||
|
})(this.subflowInstanceNodes[stopList[i]]);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
node.error(err);
|
node.error(err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user