Poll the server much less frequently if we arent using beanstalkd

This commit is contained in:
Trever Fischer
2012-11-17 16:07:44 -05:00
parent 443ed80c52
commit 57b21f9316

View File

@@ -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);
}
});
}