summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ebe7b52)
raw | patch | inline | side by side (parent: ebe7b52)
author | kedder <kedder@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 13 Jan 2003 22:14:00 +0000 (22:14 +0000) | ||
committer | kedder <kedder@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 13 Jan 2003 22:14:00 +0000 (22:14 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1448 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi/client.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 9ed580def604edd721b4514e93d53a711acf64a4..470a683d1b0e6ab10adde718e4c245e43e257e34 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
This file contains the changes to the Roundup system over time. The entries
are given with the most recent entry first.
-2003-??-?? 0.6.0 (?)
+2003-??-?? 0.6.0
- better hyperlinking in web message texts
- support setting of properties on message and file through web and
email interface (thanks John Rouillard)
cc addresses, different from address and different nosy list property)
(thanks John Rouillard)
- applied patch for nicer history display (sf feature 638280)
-
+- cleaning old unused sessions only once per hour, not on every cgi
+ request. It is greatly improves web interface performance, especially
+ on trackers under high load
2003-??-?? 0.5.5
- fixed rdbms searching by ID (sf bug 666615)
(multipart/alternative, "fw" and content-type "name")
- fire auditors and reactors in rdbms retire (thanks Sheila King)
- better match for mailgw help "command" text
-- handle :add: better in cgi form parsing (sf bug 663235)
+- handle :add: better in cgi form parsing (sf bug 6632.35)
- handle all-whitespace multilink values in forms (sf bug 663855)
- fixed searching on date / interval fields (sf bug 658157)
- fixed form elements names in search form to allow grouping and sorting
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 170d86bc87a4cd03b0e4a35e3fcebc3e4f6cb417..b2ee2072ec5f58eea2be6500c7fa8a83403749fd 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.66 2003-01-11 23:52:28 richard Exp $
+# $Id: client.py,v 1.67 2003-01-13 22:14:00 kedder Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
# everything else
self.write(cgitb.html())
+ def clean_sessions(self):
+ '''age sessions, remove when they haven't been used for a week.
+ Do it only once an hour'''
+ sessions = self.db.sessions
+ last_clean = sessions.get('last_clean', 'last_use') or 0
+
+ week = 60*60*24*7
+ hour = 60*60
+ now = time.time()
+ if now - last_clean > hour:
+ # remove age sessions
+ for sessid in sessions.list():
+ print sessid
+ interval = now - sessions.get(sessid, 'last_use')
+ if interval > week:
+ sessions.destroy(sessid)
+ sessions.set('last_clean', last_use=time.time())
+
def determine_user(self):
''' Determine who the user is
'''
# determine the uid to use
self.opendb('admin')
-
+ # clean age sessions
+ self.clean_sessions()
# make sure we have the session Class
sessions = self.db.sessions
- # age sessions, remove when they haven't been used for a week
- # TODO: this shouldn't be done every access
- week = 60*60*24*7
- now = time.time()
- for sessid in sessions.list():
- interval = now - sessions.get(sessid, 'last_use')
- if interval > week:
- sessions.destroy(sessid)
-
# look up the user session cookie
cookie = Cookie.Cookie(self.env.get('HTTP_COOKIE', ''))
user = 'anonymous'