Prevent needless retention of node status messages

This commit is contained in:
Nick O'Leary
2020-11-16 21:04:38 +00:00
parent 42f3b70a22
commit 6ea978d83d
5 changed files with 50 additions and 17 deletions

View File

@@ -18,6 +18,7 @@ const clone = require("clone");
const Flow = require('./Flow').Flow;
const context = require('../nodes/context');
const util = require("util");
const events = require("../events");
const redUtil = require("@node-red/util").util;
const flowUtil = require("./util");
@@ -308,7 +309,26 @@ class Subflow extends Flow {
super.start(diff);
}
/**
* Stop this subflow.
* The `stopList` argument helps define what needs to be stopped in the case
* of a modified-nodes/flows type deploy.
* @param {[type]} stopList [description]
* @param {[type]} removedList [description]
* @return {[type]} [description]
*/
stop(stopList, removedList) {
const nodes = Object.keys(this.activeNodes);
return super.stop(stopList, removedList).then(res => {
nodes.forEach(id => {
events.emit("node-status",{
id: id
});
})
return res;
})
}
/**
* Get environment variable of subflow
* @param {String} name name of env var