Show More
@@ -27,6 +27,7 | |||
|
27 | 27 | import os |
|
28 | 28 | import logging |
|
29 | 29 | import traceback |
|
30 | import time | |
|
30 | 31 | |
|
31 | 32 | from dulwich import server as dulserver |
|
32 | 33 | |
@@ -72,6 +73,7 from paste.httpheaders import REMOTE_USE | |||
|
72 | 73 | from rhodecode.lib import safe_str |
|
73 | 74 | from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware |
|
74 | 75 | from rhodecode.lib.utils import invalidate_cache, is_valid_repo |
|
76 | from rhodecode.model import meta | |
|
75 | 77 | from rhodecode.model.db import User |
|
76 | 78 | |
|
77 | 79 | from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError |
@@ -102,6 +104,15 class SimpleGit(object): | |||
|
102 | 104 | self.authenticate = AuthBasicAuthenticator('', authfunc) |
|
103 | 105 | |
|
104 | 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 | 116 | if not is_git(environ): |
|
106 | 117 | return self.application(environ, start_response) |
|
107 | 118 |
@@ -27,6 +27,7 | |||
|
27 | 27 | import os |
|
28 | 28 | import logging |
|
29 | 29 | import traceback |
|
30 | import time | |
|
30 | 31 | |
|
31 | 32 | from mercurial.error import RepoError |
|
32 | 33 | from mercurial.hgweb import hgweb_mod |
@@ -38,6 +39,7 from rhodecode.lib import safe_str | |||
|
38 | 39 | from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware |
|
39 | 40 | from rhodecode.lib.utils import make_ui, invalidate_cache, \ |
|
40 | 41 | is_valid_repo, ui_sections |
|
42 | from rhodecode.model import meta | |
|
41 | 43 | from rhodecode.model.db import User |
|
42 | 44 | |
|
43 | 45 | from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError |
@@ -67,6 +69,15 class SimpleHg(object): | |||
|
67 | 69 | self.ipaddr = '0.0.0.0' |
|
68 | 70 | |
|
69 | 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 | 81 | if not is_mercurial(environ): |
|
71 | 82 | return self.application(environ, start_response) |
|
72 | 83 |
General Comments 0
You need to be logged in to leave comments.
Login now