witten
/
luminotes
Archived
1
0
Fork 0

Improved page loading speed and fixed a rare session locking timeout bug by removing all implicit session locking.

This commit is contained in:
Dan Helfman 2008-10-07 14:34:33 -07:00
parent 815b05e574
commit 22f25ba274
3 changed files with 3 additions and 39 deletions

3
NEWS
View File

@ -3,8 +3,11 @@
* You can now create and end links. * You can now create and end links.
* Underline and strikethrough now work. * Underline and strikethrough now work.
* Pulldowns for search suggestions, importing, and exporting show up. * Pulldowns for search suggestions, importing, and exporting show up.
* Improved page loading speed and fixed a rare session locking timeout bug
by removing all implicit session locking.
* Fixed a bug that broke that Luminotes Desktop product download page if * Fixed a bug that broke that Luminotes Desktop product download page if
PayPal took too long to notify Luminotes of the purchase. PayPal took too long to notify Luminotes of the purchase.
1.5.2: October 1, 2008 1.5.2: October 1, 2008
* Leading/trailing spaces in note titles are now ignored when making links * Leading/trailing spaces in note titles are now ignored when making links

View File

@ -13,7 +13,6 @@ settings = {
"session_filter.storage_path": "session", "session_filter.storage_path": "session",
"session_filter.timeout": 60 * 72, # 72 hours "session_filter.timeout": 60 * 72, # 72 hours
"session_filter.clean_up_delay": 5, "session_filter.clean_up_delay": 5,
"session_filter.locking": "implicit",
"encoding_filter.on": True, "encoding_filter.on": True,
"encoding_filter.encoding": "utf-8", "encoding_filter.encoding": "utf-8",
"decoding_filter.on": True, "decoding_filter.on": True,

View File

@ -185,13 +185,6 @@ class FieldStorage( cherrypy._cpcgifs.FieldStorage ):
cherrypy.server.socket_timeout = 60 # increase socket timeout to one minute (default is 10 sec) cherrypy.server.socket_timeout = 60 # increase socket timeout to one minute (default is 10 sec)
DASHES_AND_NEWLINES = 6 # four dashes and two newlines DASHES_AND_NEWLINES = 6 # four dashes and two newlines
# release the cherrypy session lock so that the user can issue other commands while the file is
# uploading
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
# pluck the file id out of the query string. it would be preferable to grab it out of parsed # pluck the file id out of the query string. it would be preferable to grab it out of parsed
# form variables instead, but at this point in the processing, all the form variables might not # form variables instead, but at this point in the processing, all the form variables might not
# be parsed # be parsed
@ -295,13 +288,6 @@ class Files( object ):
@return: file data @return: file data
@raise Access_error: the current user doesn't have access to the notebook that the file is in @raise Access_error: the current user doesn't have access to the notebook that the file is in
""" """
# release the session lock before beginning to stream the download. otherwise, if the
# download is cancelled before it's done, the lock won't be released
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
db_file = self.__database.load( File, file_id ) db_file = self.__database.load( File, file_id )
if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ): if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ):
@ -350,13 +336,6 @@ class Files( object ):
@return: file data @return: file data
@raise Access_error: the access_id is unknown or doesn't grant access to the file @raise Access_error: the access_id is unknown or doesn't grant access to the file
""" """
# release the session lock before beginning to stream the download. otherwise, if the
# download is cancelled before it's done, the lock won't be released
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
# load the download_access object corresponding to the given id # load the download_access object corresponding to the given id
download_access = self.__database.load( Download_access, access_id ) download_access = self.__database.load( Download_access, access_id )
if download_access is None: if download_access is None:
@ -451,11 +430,6 @@ class Files( object ):
@return: thumbnail image data @return: thumbnail image data
@raise Access_error: the current user doesn't have access to the notebook that the file is in @raise Access_error: the current user doesn't have access to the notebook that the file is in
""" """
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
db_file = self.__database.load( File, file_id ) db_file = self.__database.load( File, file_id )
if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ): if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ):
@ -515,11 +489,6 @@ class Files( object ):
@return: image data @return: image data
@raise Access_error: the current user doesn't have access to the notebook that the file is in @raise Access_error: the current user doesn't have access to the notebook that the file is in
""" """
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
db_file = self.__database.load( File, file_id ) db_file = self.__database.load( File, file_id )
if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ): if not db_file or not self.__users.check_access( user_id, db_file.notebook_id ):
@ -707,13 +676,6 @@ class Files( object ):
""" """
global current_uploads global current_uploads
# release the session lock before beginning to stream the upload report. otherwise, if the
# upload is cancelled before it's done, the lock won't be released
try:
cherrypy.session.release_lock()
except ( KeyError, OSError ):
pass
# poll until the file is uploading (as determined by current_uploads) or completely uploaded (in # poll until the file is uploading (as determined by current_uploads) or completely uploaded (in
# the database with a filename) # the database with a filename)
while True: while True: