mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 22:38:43 +00:00
Seperate initial unsub delay from refresh on update unsub delay
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user