Skip to content

Commit

Permalink
debug...
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Jan 9, 2025
1 parent da0cb89 commit db90182
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nlds_processors/catalog/catalog_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ def _get_or_create_holding(
self.log(message, RK.LOG_DEBUG)
raise CatalogError(message)
try:
holding = self.catalog.create_holding(user, group, new_label)
# does the holding exist with the new_label? This might happen if
# the transaction is interrupted
try:
holding = self.catalog.get_holding(user, group, label=new_label)
except (KeyError, CatalogError):
holding = self.catalog.create_holding(user, group, new_label)
except CatalogError as e:
self.log(e.message, RK.LOG_ERROR)
raise e
Expand Down

0 comments on commit db90182

Please sign in to comment.