We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e90195 commit 38fae69Copy full SHA for 38fae69
1 file changed
label_studio/tasks/functions.py
@@ -198,7 +198,8 @@ def update_tasks_counters(queryset, from_scratch=True):
198
)
199
200
# filter our tasks with 0 annotations and 0 predictions and update them with 0
201
- queryset.filter(annotations__isnull=True, predictions__isnull=True).update(
+ # order_by('id') ensures consistent row locking order to prevent deadlocks
202
+ queryset.filter(annotations__isnull=True, predictions__isnull=True).order_by('id').update(
203
total_annotations=0, cancelled_annotations=0, total_predictions=0
204
205
0 commit comments