api: use sane default in wrap_db_retry()
The current defaults do not make much sense: having max_retries set to 0 completely avoid any retry, which is the whole point of that wrapper. This patch moves the correct default values from the DBAPI object to the wrap_db_retry() function itself. Change-Id: I89c2bd09e69b8b77b716573eb8b889c01f9d0f54
This commit is contained in:
@@ -207,9 +207,9 @@ class DBRetryRequestCase(DBAPITestCase):
|
||||
some_method()
|
||||
|
||||
def test_retry_wrapper_reaches_limit(self):
|
||||
max_retries = 10
|
||||
max_retries = 2
|
||||
|
||||
@api.wrap_db_retry(max_retries=10)
|
||||
@api.wrap_db_retry(max_retries=max_retries)
|
||||
def some_method(res):
|
||||
res['result'] += 1
|
||||
raise exception.RetryRequest(ValueError())
|
||||
|
||||
Reference in New Issue
Block a user