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
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user