Skip to content

Commit

Permalink
fix: fix error retrieving status for queued jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Nov 22, 2024
1 parent 5626029 commit c2a3fc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ai4papi/nomad/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def get_deployment(

# Replace Nomad status with a more user-friendly status
# Final list includes: starting, down, running, complete, failed, ...
status = a['TaskStates']['main']['State'] # more relevant than a['ClientStatus']
# We use the status of the "main" task because it isn more relevant the the
# status of the overall job (a['ClientStatus'])
status = a['TaskStates']['main']['State'] if a.get('TaskStates') else 'queued'
status_map = { # nomad: papi
'pending': 'starting',
'unknown': 'down',
Expand Down

0 comments on commit c2a3fc6

Please sign in to comment.