Merge "Use correct retry mechanism in tags"
This commit is contained in:
commit
038597e794
|
@ -15,8 +15,6 @@
|
|||
import functools
|
||||
|
||||
from neutron_lib.plugins import directory
|
||||
from oslo_db import api as oslo_db_api
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import helpers as log_helpers
|
||||
from sqlalchemy.orm import exc
|
||||
|
||||
|
@ -79,9 +77,7 @@ class TagPlugin(common_db_mixin.CommonDbMixin, tag_ext.TagPluginBase):
|
|||
raise tag_ext.TagNotFound(tag=tag)
|
||||
|
||||
@log_helpers.log_method_call
|
||||
@oslo_db_api.wrap_db_retry(
|
||||
max_retries=db_api.MAX_RETRIES,
|
||||
exception_checker=lambda e: isinstance(e, db_exc.DBDuplicateEntry))
|
||||
@db_api.retry_if_session_inactive()
|
||||
def update_tags(self, context, resource, resource_id, body):
|
||||
with db_api.context_manager.writer.using(context):
|
||||
# We get and do all operations with objects in one session
|
||||
|
|
Loading…
Reference in New Issue