disable session locking for now
we don't use sessions for anything critial. the custom database session library locks the session for commit, and this happens every request, which is not optimal. for now, disable session locking.
This commit is contained in:
parent
50a55f08df
commit
0482dcc3ac
|
@ -473,6 +473,8 @@ def main():
|
||||||
'/static': {"tools.staticdir.on": True,
|
'/static': {"tools.staticdir.on": True,
|
||||||
"tools.staticdir.dir": os.path.join(APPROOT, "styles/dist")
|
"tools.staticdir.dir": os.path.join(APPROOT, "styles/dist")
|
||||||
if not args.debug else os.path.abspath("styles/dist")},
|
if not args.debug else os.path.abspath("styles/dist")},
|
||||||
|
'/thumb': {'tools.expires.on': True,
|
||||||
|
'tools.expires.secs': 7 * 86400},
|
||||||
'/login': {'tools.auth_basic.on': True,
|
'/login': {'tools.auth_basic.on': True,
|
||||||
'tools.auth_basic.realm': 'photolib',
|
'tools.auth_basic.realm': 'photolib',
|
||||||
'tools.auth_basic.checkpassword': validate_password}})
|
'tools.auth_basic.checkpassword': validate_password}})
|
||||||
|
|
|
@ -36,8 +36,8 @@ class DatabaseSession(cherrypy.lib.sessions.Session):
|
||||||
|
|
||||||
def _load(self):
|
def _load(self):
|
||||||
if not self.cached:
|
if not self.cached:
|
||||||
self.cached = cherrypy.request.db.query(Session).filter(Session.session_id == self.id). \
|
self.cached = cherrypy.request.db.query(Session).filter(Session.session_id == self.id).first()
|
||||||
with_for_update().first()
|
# with_for_update()
|
||||||
|
|
||||||
if self.cached:
|
if self.cached:
|
||||||
return pickle.loads(self.cached.data)
|
return pickle.loads(self.cached.data)
|
||||||
|
|
Loading…
Reference in New Issue