Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 32808:eede022fc142
profile: drop maybeprofile
It seems sufficiently simple to use "profile(enabled=X)" to not justify having
a dedicated context manager just to read the config.
(I do not have a too strong opinion about this).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 09 Jun 2017 12:29:29 +0100 |
parents | bd3cb917761a |
children | c8f212cb0c83 |
comparison
equal
deleted
inserted
replaced
32807:545f69cd6042 | 32808:eede022fc142 |
---|---|
218 return True | 218 return True |
219 | 219 |
220 return False | 220 return False |
221 | 221 |
222 def run_wsgi(self, req): | 222 def run_wsgi(self, req): |
223 with profiling.maybeprofile(self.ui): | 223 profile = self.ui.configbool('profiling', 'enabled') |
224 with profiling.profile(self.ui, enabled=profile): | |
224 for r in self._runwsgi(req): | 225 for r in self._runwsgi(req): |
225 yield r | 226 yield r |
226 | 227 |
227 def _runwsgi(self, req): | 228 def _runwsgi(self, req): |
228 try: | 229 try: |