# HG changeset patch # User Mads Kiilerich # Date 2019-11-24 00:16:31 # Node ID 1a409593f352a64d311792e9bfc7b9d33152cec5 # Parent a1115795fabb44a5e6c7212c8df6b78a1643ef87 app: drop finally handling in BaseVCSController.__call__ Our optional 'wrapper' middleware is logging response times more correctly after b42ee1bdf082 - there is no point in logging the timing of the __call__ in the main app. Similarly, the session was removed too early. But TurboGears is already picking up our db session and using DBSessionRemoverMiddleware to .remove() it ... and at the right time. So just stop trying. diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -30,7 +30,6 @@ Original author and date, and relevant c import datetime import logging -import time import traceback import warnings @@ -300,7 +299,6 @@ class BaseVCSController(object): return _get_ip_addr(environ) def __call__(self, environ, start_response): - start = time.time() try: # try parsing a request for this VCS - if it fails, call the wrapped app parsed_request = self.parse_request(environ) @@ -343,10 +341,6 @@ class BaseVCSController(object): except webob.exc.HTTPException as e: return e(environ, start_response) - finally: - log_ = logging.getLogger('kallithea.' + self.__class__.__name__) - log_.debug('Request time: %.3fs', time.time() - start) - meta.Session.remove() class BaseController(TGController):