From d1d0b7f4aa7c3c491f5164cea401c43fb2f26680 Mon Sep 17 00:00:00 2001 From: Anthony Parsons Date: Sun, 30 Apr 2006 15:38:13 +0000 Subject: [PATCH] Make boardlist update only fire once every 5 minutes --- js/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 4ff4492..df41077 100644 --- a/js/index.js +++ b/js/index.js @@ -4,6 +4,7 @@ */ var boardlist; +var blCycle = 0; function blUpdate() { if ( boardlist.readyState == 4 && boardlist.status == 200 ) { @@ -16,9 +17,12 @@ function blUpdate() { // Get boardlist every few seconds timers.things.push( function() { - boardlist = new XMLHttpRequest(); - boardlist.onreadystatechange = blUpdate; - boardlist.open('GET', 'index?xml', true); - boardlist.send(null); + if ( blCycle % 5 ) { + boardlist = new XMLHttpRequest(); + boardlist.onreadystatechange = blUpdate; + boardlist.open('GET', 'index?xml', true); + boardlist.send(null); + } + blCycle++; } ) -- 2.11.4.GIT