From c007f10a48c02b14d0b5b8d9745c8f7047f23106 Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Mon, 13 May 2024 19:54:40 -0500 Subject: [PATCH] tes --- src/api/src/backend/views/PipelineLocks.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/src/backend/views/PipelineLocks.py b/src/api/src/backend/views/PipelineLocks.py index c04810e7..f394188b 100644 --- a/src/api/src/backend/views/PipelineLocks.py +++ b/src/api/src/backend/views/PipelineLocks.py @@ -93,19 +93,19 @@ def post(self, request, group_id, pipeline_id): # or created a pipeline lock in the previous steps above, but for # some reason (pipeline, pipeline_run, or pipeline_lock were deleted # with exceptional timing) the pipeline lock doesn't exist anymore - if pipeline_lock.uuid not in [lock.uuid for lock in pipeline_locks]: + if str(pipeline_lock.uuid) not in [str(lock.uuid) for lock in pipeline_locks]: 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 = [ - lock.pipeline_run + str(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 - if pipeline_lock.pipeline_run.uuid == competing_runs[0]: + if str(pipeline_lock.pipeline_run.uuid) == competing_runs[0]: acquired_at = timezone.now() pipeline_lock.object.update(acquired_at=acquired_at) @@ -195,12 +195,10 @@ def get(self, request, group_id, pipeline_id, pipeline_lock_uuid=None, *_, **__ # locks for this pipeline if pipeline_lock_uuid == None: return self.list(pipeline) - - print(pipeline.pipelinelocks.all()) lock_model = next( filter( - lambda lock: lock.uuid == pipeline_lock_uuid, + lambda lock: str(lock.uuid) == pipeline_lock_uuid, pipeline.pipelinelocks.all() ), None