Skip to content

Commit

Permalink
fix: add more statuses when allowing purging
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Sep 9, 2024
1 parent de9b373 commit 5b4c67f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ai4papi/nomad/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def get_deployment(
elif a['ClientStatus'] == 'unknown':
info['status'] = 'down'
else:
# This status can be for example: "complete", "failed"
info['status'] = a['ClientStatus']

# Add error messages if needed
Expand Down Expand Up @@ -346,10 +347,10 @@ def delete_deployment(
full_info=False,
)

# If job is in "queued" status, allow deleting with purge.
# If job is in stuck status, allow deleting with purge.
# Most of the time, when a job is in this status, it is due to a platform error.
# It gets stuck and cannot be deleted without purge
if info['status'] == 'queued':
if info['status'] in ['queued', 'complete', 'failed', 'error', 'down'] :
purge = True
else:
purge = False
Expand Down

0 comments on commit 5b4c67f

Please sign in to comment.