Mercurial Hosting > chat
diff src/chat.js @ 42:e09747b199e9
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 27 Feb 2025 19:30:54 -0700 |
parents | 7ea33179592a |
children | 42b741a1d5c6 |
line wrap: on
line diff
--- a/src/chat.js Thu Feb 27 19:05:57 2025 -0700 +++ b/src/chat.js Thu Feb 27 19:30:54 2025 -0700 @@ -218,10 +218,12 @@ } } -setInterval(function(){ +function heartbeat() { showOnline(); ajax(`heartbeat.js?last_update=${lastUpdate}`); -}, 10000 ); +} + +setInterval( heartbeat, 10000 ); let online = {}; @@ -230,7 +232,7 @@ } function showOnline() { - let old = Date.now() - 20000; + let old = Date.now() - 70000; for( let id of Object.keys(online) ) { if( online[id] < old ) delete online[id];