I'd like to note that I've added a pageid scope feature already, so all thats needed is something like this:
07:51 <lifeless> === modified file 'lib/canonical/launchpad/webapp/adapter.py' 07:51 <lifeless> --- lib/canonical/launchpad/webapp/adapter.py 2010-09-14 04:52:39 +0000 07:51 <lifeless> +++ lib/canonical/launchpad/webapp/adapter.py 2010-09-17 19:50:58 +0000 07:51 <lifeless> @@ -272,6 +272,13 @@ 07:51 <lifeless> if not getattr(_local, 'enable_timeout', True): 07:51 <lifeless> return None 07:51 <lifeless> if timeout is None: 07:51 <lifeless> + timeout_str = getFeatureFlag('hard_timeout') 07:51 <lifeless> + if timeout_str: 07:51 <lifeless> + try: 07:51 <lifeless> + timeout = float(timeout_str) 07:51 <lifeless> + except ValueError: 07:51 <lifeless> + logging.error('invalid hard timeout flag %r', timeout_str) 07:51 <lifeless> + if timeout is None: 07:51 <lifeless> timeout = config.database.db_statement_timeout 07:51 <lifeless> if not timeout: 07:51 <lifeless> return None
(and tests) grepping for 'lp.services.features' in existing doctests will show (a way) to do it.
I'd like to note that I've added a pageid scope feature already, so all thats needed is something like this:
07:51 <lifeless> === modified file 'lib/canonical/ launchpad/ webapp/ adapter. py' launchpad/ webapp/ adapter. py 2010-09-14 04:52:39 +0000 launchpad/ webapp/ adapter. py 2010-09-17 19:50:58 +0000 'hard_timeout' ) error(' invalid hard timeout flag %r', timeout_str) database. db_statement_ timeout
07:51 <lifeless> --- lib/canonical/
07:51 <lifeless> +++ lib/canonical/
07:51 <lifeless> @@ -272,6 +272,13 @@
07:51 <lifeless> if not getattr(_local, 'enable_timeout', True):
07:51 <lifeless> return None
07:51 <lifeless> if timeout is None:
07:51 <lifeless> + timeout_str = getFeatureFlag(
07:51 <lifeless> + if timeout_str:
07:51 <lifeless> + try:
07:51 <lifeless> + timeout = float(timeout_str)
07:51 <lifeless> + except ValueError:
07:51 <lifeless> + logging.
07:51 <lifeless> + if timeout is None:
07:51 <lifeless> timeout = config.
07:51 <lifeless> if not timeout:
07:51 <lifeless> return None
(and tests) grepping for 'lp.services. features' in existing doctests will show (a way) to do it.