Skip to content

Commit

Permalink
increase log level, remove trycatch block
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Wolfe committed Oct 11, 2024
1 parent 05b1753 commit 4c88126
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions djautotask/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,13 @@ def prune_stale_records(self, initial_ids, synced_ids):
)
)
if self.bulk_prune:
try:
delete_qset.delete()
except IntegrityError as e:
logger.error(
'IntegrityError while attempting to '
'delete {} records. Error: {}'.format(
self.model_class.__bases__[0].__name__, e)
)
delete_qset.delete()
else:
for instance in delete_qset:
try:
instance.delete()
except DatabaseError as e:
logger.error(
except IntegrityError as e:
logger.exception(
'A database error occurred while attempting to '
'delete {} records. Error: {}'.format(
self.model_class.__bases__[0].__name__,
Expand Down

0 comments on commit 4c88126

Please sign in to comment.