Skip to content

Commit 6dd69e5

Browse files
authored
try possible fix to avoid a oracle regression (#325)
1 parent 3b34dd9 commit 6dd69e5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

django_celery_results/backends/database.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ def on_chord_part_return(self, request, state, result, **kwargs):
236236
# wrap the update in a transaction
237237
# with a `select_for_update` lock to prevent race conditions.
238238
# SELECT FOR UPDATE is not supported on all databases
239-
chord_counter = (
240-
ChordCounter.objects.select_for_update()
241-
.filter(group_id=gid).first()
242-
)
243-
if chord_counter is None:
239+
try:
240+
chord_counter = (
241+
ChordCounter.objects.select_for_update()
242+
.get(group_id=gid)
243+
)
244+
except ChordCounter.DoesNotExist:
244245
logger.warning("Can't find ChordCounter for Group %s", gid)
245246
return
246247
chord_counter.count -= 1

0 commit comments

Comments
 (0)