From 3f61c32f1e478c20e078aa90636b3228d149a5f2 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Tue, 14 May 2024 11:32:09 -0500 Subject: [PATCH] Fix pipeline lock acquisition --- src/api/src/backend/views/PipelineLocks.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/api/src/backend/views/PipelineLocks.py b/src/api/src/backend/views/PipelineLocks.py index 766050ce..86554aa2 100644 --- a/src/api/src/backend/views/PipelineLocks.py +++ b/src/api/src/backend/views/PipelineLocks.py @@ -97,16 +97,12 @@ def post(self, request, group_id, pipeline_id): raise Exception(f"PipelineLock with UUID {str(pipeline_lock.uuid)} not found.") # This list of pipeline runs competing for a lock on the pipeline - competing_runs = [ - str(lock.pipeline_run) - for lock in pipeline_locks - ] + competing_runs = [lock.pipeline_run for lock in pipeline_locks] # Check to see if the pipeline run associated with the current # pipeline lock attempt is the next in the queue. If so, update the # pipeline lock's 'acquired_at' property - print(str(pipeline_lock.pipeline_run.uuid), competing_runs[0]) - if str(pipeline_lock.pipeline_run.uuid) == competing_runs[0]: + if str(pipeline_lock.pipeline_run.uuid) == str(competing_runs[0].uuid): acquired_at = timezone.now() pipeline_lock.object.update(acquired_at=acquired_at)