Seperate initial unsub delay from refresh on update unsub delay

This commit is contained in:
G.Ambatte
2026-10-11 12:06:14 +13:00
parent 444227e44d
commit 5d494c8435
+2 -1
View File
@@ -10,6 +10,7 @@ const DEBUG = {
// Delays
const UNSUB_DELAY = 60 * 1000; //ms
const REFRESH_DELAY = 60 * 1000; //ms
const REPORT_DELAY = 5 * 1000; //ms
@@ -55,7 +56,7 @@ Stream.on('sendUpdate', (event, data)=>{
if(event == 'brewUpdated'){
// Reset the unsubscription timer
clearTimeout(sub.unsubTimer);
sub.unsubTimer = setTimeout(()=>{ unsubscribe(sub.id); }, UNSUB_DELAY);
sub.unsubTimer = setTimeout(()=>{ unsubscribe(sub.id); }, REFRESH_DELAY);
}
sub?.stream?.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);