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) {
|
||||
stopList = Object.keys(this.activeNodes);
|
||||
}
|
||||
// this.trace(" stopList: "+stopList.join(","))
|
||||
// Convert the list to a map to avoid multiple scans of the list
|
||||
var removedMap = {};
|
||||
removedList = removedList || [];
|
||||
@ -261,8 +262,9 @@ class Flow {
|
||||
delete this.activeNodes[stopList[i]];
|
||||
if (this.subflowInstanceNodes[stopList[i]]) {
|
||||
try {
|
||||
var subflow = this.subflowInstanceNodes[stopList[i]];
|
||||
promises.push(stopNode(node,false).then(() => { subflow.stop() }));
|
||||
(function(subflow) {
|
||||
promises.push(stopNode(node,false).then(() => { subflow.stop() }));
|
||||
})(this.subflowInstanceNodes[stopList[i]]);
|
||||
} catch(err) {
|
||||
node.error(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user