##// END OF EJS Templates
backported fixes for issue #318...
marcink -
r1834:d0e477b5 default
parent child Browse files
Show More
@@ -27,6 +27,7 b''
27 import os
27 import os
28 import logging
28 import logging
29 import traceback
29 import traceback
30 import time
30
31
31 from dulwich import server as dulserver
32 from dulwich import server as dulserver
32
33
@@ -72,6 +73,7 b' from paste.httpheaders import REMOTE_USE'
72 from rhodecode.lib import safe_str
73 from rhodecode.lib import safe_str
73 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
74 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
74 from rhodecode.lib.utils import invalidate_cache, is_valid_repo
75 from rhodecode.lib.utils import invalidate_cache, is_valid_repo
76 from rhodecode.model import meta
75 from rhodecode.model.db import User
77 from rhodecode.model.db import User
76
78
77 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
79 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
@@ -102,6 +104,15 b' class SimpleGit(object):'
102 self.authenticate = AuthBasicAuthenticator('', authfunc)
104 self.authenticate = AuthBasicAuthenticator('', authfunc)
103
105
104 def __call__(self, environ, start_response):
106 def __call__(self, environ, start_response):
107 start = time.time()
108 try:
109 return self._handle_request(environ, start_response)
110 finally:
111 log = logging.getLogger(self.__class__.__name__)
112 log.debug('Request time: %.3fs' % (time.time() - start))
113 meta.Session.remove()
114
115 def _handle_request(self, environ, start_response):
105 if not is_git(environ):
116 if not is_git(environ):
106 return self.application(environ, start_response)
117 return self.application(environ, start_response)
107
118
@@ -27,6 +27,7 b''
27 import os
27 import os
28 import logging
28 import logging
29 import traceback
29 import traceback
30 import time
30
31
31 from mercurial.error import RepoError
32 from mercurial.error import RepoError
32 from mercurial.hgweb import hgweb_mod
33 from mercurial.hgweb import hgweb_mod
@@ -38,6 +39,7 b' from rhodecode.lib import safe_str'
38 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
39 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
39 from rhodecode.lib.utils import make_ui, invalidate_cache, \
40 from rhodecode.lib.utils import make_ui, invalidate_cache, \
40 is_valid_repo, ui_sections
41 is_valid_repo, ui_sections
42 from rhodecode.model import meta
41 from rhodecode.model.db import User
43 from rhodecode.model.db import User
42
44
43 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
45 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
@@ -67,6 +69,15 b' class SimpleHg(object):'
67 self.ipaddr = '0.0.0.0'
69 self.ipaddr = '0.0.0.0'
68
70
69 def __call__(self, environ, start_response):
71 def __call__(self, environ, start_response):
72 start = time.time()
73 try:
74 return self._handle_request(environ, start_response)
75 finally:
76 log = logging.getLogger(self.__class__.__name__)
77 log.debug('Request time: %.3fs' % (time.time() - start))
78 meta.Session.remove()
79
80 def _handle_request(self, environ, start_response):
70 if not is_mercurial(environ):
81 if not is_mercurial(environ):
71 return self.application(environ, start_response)
82 return self.application(environ, start_response)
72
83
General Comments 0
You need to be logged in to leave comments. Login now