Prevent stream heartbeat from loading in test environments

This commit is contained in:
G.Ambatte
2026-10-13 23:13:53 +13:00
parent 8d3edc7cd1
commit 4479b7ca95
+5 -2
View File
@@ -49,13 +49,16 @@ const unsubscribe = function(id){
};
// Create heartbeat
const heartbeatId = setInterval(()=>{
const heartbeatId = config.get('node_env') != 'test' ?
setInterval(()=>{
if(DEBUG.showEvents){ console.log('STREAM HEARTBEAT @ ', new Date); };
subscribers
.forEach((sub)=>{
sub?.stream?.write(`:\n\n`);
});
}, HEARTBEAT_DELAY);
}, HEARTBEAT_DELAY)
:
undefined;
Stream.on('close', ()=>{
console.log('STREAM CLOSE');