Skip to content

Commit 58eb6c7

Browse files
committed
Fix locking for cancelling jobs
1 parent 9ce2658 commit 58eb6c7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/grandchallenge/components/admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def cancel_jobs(modeladmin, request, queryset):
151151
ComponentJob.EXECUTING_PREREQUISITES,
152152
ComponentJob.VALIDATING_INPUTS,
153153
]
154-
).select_for_update(skip_locked=True).update(status=ComponentJob.CANCELLED)
154+
).select_for_update(skip_locked=True, of=("self",)).update(
155+
status=ComponentJob.CANCELLED
156+
)
155157

156158

157159
@admin.action(

0 commit comments

Comments
 (0)