Skip to content

Commit

Permalink
backend: unknown-resalloc-tickets: check tickets taken first
Browse files Browse the repository at this point in the history
If backend is idle, there are no used tickets - we still want to check
for all the taken tickets, and report those.
  • Loading branch information
praiskup committed Oct 3, 2024
1 parent 43e5fc8 commit 0a9e16e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions backend/run/copr-backend-unknown-resalloc-tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ def print_once(message):
def _main():
script_requires_user("resalloc")

all_known = all_ids()
if not all_known:
print("no tickets taken")
return

used = used_ids()
if not used:
print("no tickets used")
return
print("no tickets used by copr-backend")

# This is the oldest ticket that Copr Backend currently uses.
min_used = min(used)
min_used = min(used) if used else 0

all_known = all_ids()
unknown = all_known - used

for unknown_id in sorted(unknown):
if unknown_id < min_used:
print_once("These are old tickets, Copr only uses newer tickets, close them:")
Expand Down

0 comments on commit 0a9e16e

Please sign in to comment.