Commit e520e7d2 authored by Julien Cigar's avatar Julien Cigar 🤘
Browse files

Merge branch 'master' of github.com:silenius/cputils

parents 13b45d0c 148df595
......@@ -10,11 +10,12 @@ class SATool(cherrypy.Tool):
def __init__(self):
super(SATool, self).__init__('on_start_resource', self.bind_session,
priority=20)
self.session = None
def _setup(self):
super(SATool, self)._setup()
cherrypy.serving.request.hooks.attach('on_end_resource',
self.remove_session, priority=80)
cherrypy.request.hooks.attach('on_end_resource',
self.remove_session, priority=80)
def bind_session(self):
self.session = cherrypy.engine.publish('get-session').pop()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment