[FIX] http.py use checked_call for concurrency retry and exception handling

bzr revid: al@openerp.com-20131110140757-tbe8yondadokd4ke
This commit is contained in:
Antony Lesuisse 2013-11-10 15:07:57 +01:00
parent 7f3133e423
commit 575376ef29
2 changed files with 6 additions and 7 deletions

View File

@ -55,9 +55,6 @@ class ir_http(osv.AbstractModel):
_description = "HTTP routing"
def __init__(self, registry, cr):
osv.osv.__init__(self, registry, cr)
def _find_handler(self):
# TODO move to __init__(self, registry, cr)
if not hasattr(self, 'routing_map'):

View File

@ -169,10 +169,12 @@ class WebRequest(object):
# Backward for 7.0
if getattr(self.func, '_first_arg_is_req', False):
args = (request,) + args
# TODO by chs
#@service_model.check
#def checked_call(dbname, *a, **kw):
# return func(*a, **kw)
# Correct exception handling and concurency retry
@service_model.check
def checked_call(dbname, *a, **kw):
return self.func(*a, **kw)
if self.db:
return checked_call(self.db, *args, **kwargs)
return self.func(*args, **kwargs)
finally:
# just to be sure no one tries to re-use the request