diff --git a/photoapp/daemon.py b/photoapp/daemon.py index aebbb29..2c7b726 100644 --- a/photoapp/daemon.py +++ b/photoapp/daemon.py @@ -473,6 +473,8 @@ def main(): '/static': {"tools.staticdir.on": True, "tools.staticdir.dir": os.path.join(APPROOT, "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, 'tools.auth_basic.realm': 'photolib', 'tools.auth_basic.checkpassword': validate_password}}) diff --git a/photoapp/dbsession.py b/photoapp/dbsession.py index 02f93bb..a9b536e 100644 --- a/photoapp/dbsession.py +++ b/photoapp/dbsession.py @@ -36,8 +36,8 @@ class DatabaseSession(cherrypy.lib.sessions.Session): def _load(self): if not self.cached: - self.cached = cherrypy.request.db.query(Session).filter(Session.session_id == self.id). \ - with_for_update().first() + self.cached = cherrypy.request.db.query(Session).filter(Session.session_id == self.id).first() + # with_for_update() if self.cached: return pickle.loads(self.cached.data)