[FIX] osv: Bad error message

bzr revid: cto@openerp.com-20130213133345-ovhlrfd2g5sb2tts
This commit is contained in:
Cecile Tonglet 2013-02-13 14:33:45 +01:00
parent 8d491afca5
commit 2346b0d88c
1 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,9 @@ class object_proxy(object):
return f(self, dbname, *args, **kwargs)
except OperationalError, e:
# Automatically retry the typical transaction serialization errors
if not e.pgcode in PG_CONCURRENCY_ERRORS_TO_RETRY or tries >= MAX_TRIES_ON_CONCURRENCY_FAILURE:
if e.pgcode not in PG_CONCURRENCY_ERRORS_TO_RETRY:
raise
if tries >= MAX_TRIES_ON_CONCURRENCY_FAILURE:
self.logger.warning("%s, maximum number of tries reached" % errorcodes.lookup(e.pgcode))
raise
wait_time = random.uniform(0.0, 2 ** tries)