[FIX] http.py use checked_call for concurrency retry and exception handling
bzr revid: al@openerp.com-20131110140757-tbe8yondadokd4ke
This commit is contained in:
parent
7f3133e423
commit
575376ef29
|
@ -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'):
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue