Skip to content

Commit

Permalink
Fix PipelineLockAcquisitionResponseSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed May 13, 2024
1 parent 121e209 commit d8a37f2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/api/specs/WorkflowsAPI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2123,8 +2123,6 @@ components:
pipeline_run_uuid:
type: string
format: uuid
acquired:
type: boolean
created_at:
type: string
acquired_at:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class PipelineLockAcquisitionResponseSerializer:
@staticmethod
def serialize(pipeline_lock, message):
return {
"acquired": pipeline_lock.acquired,
"acquired": pipeline_lock.acquired_at != None,
"message": message,
"pipeline_lock_uuid": UUIDSerializer.serialize(pipeline_lock.uuid)
}
2 changes: 1 addition & 1 deletion src/api/src/backend/views/PipelineLocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def post(self, request, group_id, pipeline_id):

# 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' property to 'true'
# pipeline lock's 'acquired_at' property
if pipeline_lock.pipeline_run.uuid == competing_runs[0]:
acquired_at = timezone.now()
pipeline_lock.object.update(acquired_at=acquired_at)
Expand Down

0 comments on commit d8a37f2

Please sign in to comment.