quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Gallacher <...@jgassociates.ca>
Subject FileSession.py - improved? version
Date Mon, 11 Apr 2005 04:41:19 GMT
Hello All,

I've attached an alternative version of FileSession.py. A couple of 
changes from the original version:

1. Uses PythonOption FileSessionDir to determine directory where session 
files will be save. If this option does not exists, it defaults to 
tempfile.tempdir().

2. Does file locking independent of the session locking. File locking 
always occurs, while session locking is still optional. I'm finding that 
session locking still causes some problems, so I've changed the default 
for session locking to 0.

3. Fixed a bug in do_cleanup which was calling time(), not time.time() 
and added import time statement.

4. Added do_cleanup() optimizations. Two parameters now control the 
behaviour of do_cleanup(). The session file mtime can be used to 
determine if the file is a deletion candidate. If it is it can either be 
deleted immediately or unpickled and the true session expiration 
verified. The speedup can be significant for more than 10,000 sessions.

Regards,
Jim

Mime
View raw message