mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 22:38:43 +00:00
Prevent stream heartbeat from loading in test environments
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user