Skip to content

Commit

Permalink
fix: better catch missing tryme resources
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Sep 23, 2024
1 parent 9c0243f commit dda2ff3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ai4papi/routers/v1/try_me/nomad.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_deployment(
for k in keys:
status[k] += node[k]
for r in resources:
if status[f"{r}_used"] / status[f"{r}_total"] > 0.95:
if status[f"{r}_total"] == 0 or status[f"{r}_used"] / status[f"{r}_total"] > 0.95:
raise HTTPException(
status_code=503,
detail="Sorry, but there seem to be no resources available right " \
Expand Down

0 comments on commit dda2ff3

Please sign in to comment.