mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Ensure all subflow instances are stopped when flow stopping
Fixes #2095
This commit is contained in:
		@@ -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);
 | 
			
		||||
                    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user