mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Prevent needless retention of node status messages
This commit is contained in:
@@ -38,12 +38,20 @@ function handleCommsEvent(event) {
|
||||
publish(event.topic,event.data,event.retain);
|
||||
}
|
||||
function handleStatusEvent(event) {
|
||||
var status = {
|
||||
text: event.status.text,
|
||||
fill: event.status.fill,
|
||||
shape: event.status.shape
|
||||
};
|
||||
publish("status/"+event.id,status,true);
|
||||
if (!event.status) {
|
||||
delete retained["status/"+event.id]
|
||||
} else if (!event.status.text && !event.status.fill && !event.status.shape) {
|
||||
if (retained["status/"+event.id]) {
|
||||
publish("status/"+event.id,{},false);
|
||||
}
|
||||
} else {
|
||||
var status = {
|
||||
text: event.status.text,
|
||||
fill: event.status.fill,
|
||||
shape: event.status.shape
|
||||
};
|
||||
publish("status/"+event.id,status,true);
|
||||
}
|
||||
}
|
||||
function handleRuntimeEvent(event) {
|
||||
runtime.log.trace("runtime event: "+JSON.stringify(event));
|
||||
|
Reference in New Issue
Block a user