Skip to content

Commit

Permalink
Decrement queue size metric on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin5605 committed Nov 22, 2024
1 parent 6cd80f9 commit eb7820b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mainframe/endpoints/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def submit_results(
log.error(
f"Scan {name}@{version} already in a FINISHED state", error_message=error.detail, tag="already_finished"
)
packages_fail.inc()
packages_in_queue.dec()
raise error

Expand All @@ -76,6 +75,10 @@ def submit_results(
scan.fail_reason = result.reason

session.commit()

packages_fail.inc()
packages_in_queue.dec()

return

scan.status = Status.FINISHED
Expand Down

0 comments on commit eb7820b

Please sign in to comment.