From e3669b44659649bce13b83a92101693bb9ee6051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eli=C3=A1n=20Hanisch?= Date: Mon, 7 Nov 2011 19:13:43 -0300 Subject: [PATCH] Don't show the last bans when the page is loaded, it takes a lot of time. This is due to sqlite2, sqlite3 doesn't have this problem. --- Bantracker/cgi/bans.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Bantracker/cgi/bans.cgi b/Bantracker/cgi/bans.cgi index 52eb992..3707127 100755 --- a/Bantracker/cgi/bans.cgi +++ b/Bantracker/cgi/bans.cgi @@ -233,7 +233,7 @@ print '' tz = pytz.timezone(tz) -haveQuery = form.has_key('query') or form.has_key('channel') or form.has_key('operator') +haveQuery = 'query' in form or 'channel' in form or 'operator' in form def isOn(k): default = not haveQuery @@ -284,6 +284,12 @@ print '' print '
' print '' +if not haveQuery: + # sqlite2 sucks, getting the last bans takes a lot of time. + # so lets disable that so at least the page loads quickly. + print '
' + send_page('bans.tmpl') + # Select and filter bans def getBans(id=None, mask=None, kicks=True, oldbans=True, bans=True, floodbots=True, operator=None, channel=None, limit=None, offset=0, withCount=False):