Ensure atomic updates for workloads
This commit is contained in:
1 parent
36fc79487b
commit
3b1821035d
1 file changed
+2
-1
+2
-1
@@ -375,7 +375,8 @@ def update_test(request, machine):
|
||||
|
||||
with transaction.atomic():
|
||||
|
||||
test = Test.objects.get(id=test_id)
|
||||
test = Test.objects.select_for_update().get(id=test.id)
|
||||
|
||||
if test.finished or test.deleted:
|
||||
return { 'stop' : True }
|
||||
|
||||
|
||||
Reference in new issue
Block a user