Skip to content

Commit

Permalink
api: fix first position at queue position info
Browse files Browse the repository at this point in the history
This becomes awkward but it's possible to be first in line without being
served just yet. Return 0 rather than a confusing -1.

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Aug 14, 2021
1 parent 69cef35 commit 59bcc75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def return_job(job):
status = 202
response = {
"status": job.get_status(),
"queue_position": job.get_position() or -1,
"queue_position": job.get_position() or 0,
}

elif job.is_started:
Expand Down

0 comments on commit 59bcc75

Please sign in to comment.