From 57b21f93161a9fe0324c45e41d173faa8cf831fc Mon Sep 17 00:00:00 2001 From: Trever Fischer Date: Sat, 17 Nov 2012 16:07:44 -0500 Subject: [PATCH] Poll the server much less frequently if we arent using beanstalkd --- static/js/poll.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/poll.js b/static/js/poll.js index b2f3593..aed7a2b 100644 --- a/static/js/poll.js +++ b/static/js/poll.js @@ -29,7 +29,11 @@ function pollMessages(id) { $('#time-display').html(t.toLocaleTimeString()); } }); - window.setTimeout(function() {pollMessages(data['poll-id'])}, 1); + if (data['is-live']) { + window.setTimeout(function() {pollMessages(data['poll-id'])}, 1); + } else { + window.setTimeout(function() {pollMessages(data['poll-id'])}, 100000); + } }); }