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
+10 -7
View File
@@ -49,13 +49,16 @@ const unsubscribe = function(id){
}; };
// Create heartbeat // Create heartbeat
const heartbeatId = setInterval(()=>{ const heartbeatId = config.get('node_env') != 'test' ?
if(DEBUG.showEvents){ console.log('STREAM HEARTBEAT @ ', new Date); }; setInterval(()=>{
subscribers if(DEBUG.showEvents){ console.log('STREAM HEARTBEAT @ ', new Date); };
.forEach((sub)=>{ subscribers
sub?.stream?.write(`:\n\n`); .forEach((sub)=>{
}); sub?.stream?.write(`:\n\n`);
}, HEARTBEAT_DELAY); });
}, HEARTBEAT_DELAY)
:
undefined;
Stream.on('close', ()=>{ Stream.on('close', ()=>{
console.log('STREAM CLOSE'); console.log('STREAM CLOSE');